fix locale definitions starting with AM/PM (#4408)
* adapt locale script to fix locales starting with AM/PM * fix korean locales that start with AM / PM * added missing uk and zh_Hant locales
This commit is contained in:
@@ -199,7 +199,7 @@
|
|||||||
],
|
],
|
||||||
'en_CH' =>
|
'en_CH' =>
|
||||||
[
|
[
|
||||||
'date' => 'dd/MM/y',
|
'date' => 'dd.MM.y',
|
||||||
'time' => 'HH:mm',
|
'time' => 'HH:mm',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
@@ -457,7 +457,7 @@
|
|||||||
],
|
],
|
||||||
'en_MV' =>
|
'en_MV' =>
|
||||||
[
|
[
|
||||||
'date' => 'M/d/yy',
|
'date' => 'd-M-yy',
|
||||||
'time' => 'HH:mm',
|
'time' => 'HH:mm',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
@@ -1316,19 +1316,19 @@
|
|||||||
'ko' =>
|
'ko' =>
|
||||||
[
|
[
|
||||||
'date' => 'yy. M. d.',
|
'date' => 'yy. M. d.',
|
||||||
'time' => 'a h:mm',
|
'time' => 'h:mm a',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
'ko_KP' =>
|
'ko_KP' =>
|
||||||
[
|
[
|
||||||
'date' => 'yy. M. d.',
|
'date' => 'yy. M. d.',
|
||||||
'time' => 'a h:mm',
|
'time' => 'h:mm a',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
'ko_KR' =>
|
'ko_KR' =>
|
||||||
[
|
[
|
||||||
'date' => 'yy. M. d.',
|
'date' => 'yy. M. d.',
|
||||||
'time' => 'a h:mm',
|
'time' => 'h:mm a',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
'nb_NO' =>
|
'nb_NO' =>
|
||||||
@@ -1589,6 +1589,12 @@
|
|||||||
'time' => 'HH:mm',
|
'time' => 'HH:mm',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
|
'uk' =>
|
||||||
|
[
|
||||||
|
'date' => 'dd.MM.yy',
|
||||||
|
'time' => 'HH:mm',
|
||||||
|
'rtl' => false,
|
||||||
|
],
|
||||||
'vi' =>
|
'vi' =>
|
||||||
[
|
[
|
||||||
'date' => 'dd/MM/y',
|
'date' => 'dd/MM/y',
|
||||||
@@ -1607,4 +1613,10 @@
|
|||||||
'time' => 'HH:mm',
|
'time' => 'HH:mm',
|
||||||
'rtl' => false,
|
'rtl' => false,
|
||||||
],
|
],
|
||||||
|
'zh_Hant' =>
|
||||||
|
[
|
||||||
|
'date' => 'y/M/d',
|
||||||
|
'time' => 'Bh:mm',
|
||||||
|
'rtl' => false,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
@@ -101,6 +101,14 @@ final class RegenerateLocalesCommand extends Command
|
|||||||
$settings['date'] = $shortDate->getPattern();
|
$settings['date'] = $shortDate->getPattern();
|
||||||
$settings['time'] = $shortTime->getPattern();
|
$settings['time'] = $shortTime->getPattern();
|
||||||
|
|
||||||
|
// see https://github.com/kimai/kimai/issues/4402 - Korean time format failed parsing
|
||||||
|
// special case when time pattern starts with A / a => this will lead to an error
|
||||||
|
// \DateTimeImmutable::getLastErrors() => Meridian can only come after an hour has been found
|
||||||
|
if (str_contains($settings['time'], 'a ')) {
|
||||||
|
$settings['time'] = str_replace('a ', '', $settings['time']) . ' a';
|
||||||
|
}
|
||||||
|
$settings['time'] = str_replace("\u{202f}", ' ', $settings['time']);
|
||||||
|
|
||||||
// make sure that sub-locales of a RTL language are also flagged as RTL
|
// make sure that sub-locales of a RTL language are also flagged as RTL
|
||||||
$rtlLocale = $locale;
|
$rtlLocale = $locale;
|
||||||
if (substr_count($rtlLocale, '_') === 1) {
|
if (substr_count($rtlLocale, '_') === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user