Improve autotranslating of times before 1.1.1000
This commit is contained in:
parent
c9d8d4bdbd
commit
830b37f547
|
@ -669,6 +669,8 @@ final class NodaTimeAutotranslater {
|
||||||
return self::translateYearsWithSuffix($timeInfo);
|
return self::translateYearsWithSuffix($timeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$suffixMode = self::getSuffixModeForYearsWSuffix((intval($timeInfo['zeit_beginn']) - 1), intval($timeInfo['zeit_ende']));
|
||||||
|
|
||||||
if (trim((string)$timeInfo['zeit_zaehlzeit_tag'], ", .0") === "") {
|
if (trim((string)$timeInfo['zeit_zaehlzeit_tag'], ", .0") === "") {
|
||||||
$dateStr = "{$timeInfo['zeit_zaehlzeit_jahr']}-{$timeInfo['zeit_zaehlzeit_monat']}-05 00:00:01";
|
$dateStr = "{$timeInfo['zeit_zaehlzeit_jahr']}-{$timeInfo['zeit_zaehlzeit_monat']}-05 00:00:01";
|
||||||
$usecase = self::USECASE_MONTH;
|
$usecase = self::USECASE_MONTH;
|
||||||
|
@ -690,7 +692,7 @@ final class NodaTimeAutotranslater {
|
||||||
$tLangValue = strftime(getDateFormatByLang($tLang), $dateGeneral ?: 0);
|
$tLangValue = strftime(getDateFormatByLang($tLang), $dateGeneral ?: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output[$tLang] = $tLangValue;
|
$output[$tLang] = self::applyBcBceFormat($tLang, $tLangValue, $suffixMode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ final class NodaTimeAutotranslaterTest extends TestCase {
|
||||||
"zeit_zaehlzeit_tag" => "01",
|
"zeit_zaehlzeit_tag" => "01",
|
||||||
];
|
];
|
||||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||||
self::assertEquals($output["de"], "01.05.20");
|
self::assertEquals($output["de"], "01.05.20 n. Chr.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user