Skip to content

Commit

Permalink
Fixed issue #19294: Date/Time question for month/day/year and hour/mi…
Browse files Browse the repository at this point in the history
…nute are not translated (#3650)
  • Loading branch information
Shnoulle committed Dec 11, 2023
1 parent 2a7d425 commit 3158c70
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions application/core/QuestionTypes/Date/RenderDate.php
Expand Up @@ -128,7 +128,13 @@ private function getDaySelect($iCurrent)
{
return Yii::app()->twigRenderer->renderQuestion(
$this->getMainView() . '/dropdown/rows/day',
array('dayId' => $this->sSGQA, 'currentday' => $iCurrent),
array(
'dayId' => $this->sSGQA,
'currentday' => $iCurrent,
'lang' => [
'Day' => gT("Day")
]
),
true
);
}
Expand All @@ -138,7 +144,14 @@ private function getMonthSelect($iCurrent)

return Yii::app()->twigRenderer->renderQuestion(
$this->getMainView() . '/dropdown/rows/month',
array('monthId' => $this->sSGQA, 'currentmonth' => $iCurrent, 'montharray' => $this->getTranslatorData()['montharray']),
array(
'monthId' => $this->sSGQA,
'currentmonth' => $iCurrent,
'montharray' => $this->getTranslatorData()['montharray'],
'lang' => [
'Month' => gT("Month")
]
),
true
);
}
Expand Down Expand Up @@ -185,7 +198,10 @@ private function getYearSelect($iCurrent)
'yearmax' => $yearmax,
'reverse' => $reverse,
'yearmin' => $yearmin,
'step' => $step
'step' => $step,
'lang' => [
'Year' => gT("Year")
]
),
true
);
Expand All @@ -195,7 +211,14 @@ private function getHourSelect($iCurrent, $datepart)
{
return Yii::app()->twigRenderer->renderQuestion(
$this->getMainView() . '/dropdown/rows/hour',
array('hourId' => $this->sSGQA, 'currenthour' => $iCurrent, 'datepart' => $datepart),
array(
'hourId' => $this->sSGQA,
'currenthour' => $iCurrent,
'datepart' => $datepart,
'lang' => [
'Hour' => gT("Hour")
]
),
true
);
}
Expand All @@ -208,7 +231,10 @@ private function getMinuteSelect($iCurrent, $datepart)
'minuteId' => $this->sSGQA,
'currentminute' => $iCurrent,
'dropdown_dates_minute_step' => $this->getQuestionAttribute('dropdown_dates_minute_step'),
'datepart' => $datepart
'datepart' => $datepart,
'lang' => [
'Minute' => gT("Minute")
]
),
true
);
Expand Down Expand Up @@ -325,8 +351,7 @@ public function renderDropdownDates($dateoutput, $coreClass)
LSYii_ClientScript::POS_POSTSCRIPT,
true
);



// ==> answer
$answer = Yii::app()->twigRenderer->renderQuestion(
$this->getMainView() . '/dropdown/answer',
Expand All @@ -339,6 +364,14 @@ public function renderDropdownDates($dateoutput, $coreClass)
'checkconditionFunction' => $this->checkconditionFunction . '(this.value, this.name, this.type)',
'dateformatdetails' => $this->aDateformatDetails['jsdate'],
'dateformat' => $this->aDateformatDetails['jsdate'],
/* language part, to be translated (see issue #19294) */
'lang' => [
'Day' => gT("Day"),
'Month' => gT("Month"),
'Year' => gT("Year"),
'Hour' => gT("Hour"),
'Minute' => gT("Minute"),
]
),
true
);
Expand Down

0 comments on commit 3158c70

Please sign in to comment.