diff --git a/config/locales.php b/config/locales.php index dc7fc5e5..838dd580 100644 --- a/config/locales.php +++ b/config/locales.php @@ -199,7 +199,7 @@ ], 'en_CH' => [ - 'date' => 'dd/MM/y', + 'date' => 'dd.MM.y', 'time' => 'HH:mm', 'rtl' => false, ], @@ -457,7 +457,7 @@ ], 'en_MV' => [ - 'date' => 'M/d/yy', + 'date' => 'd-M-yy', 'time' => 'HH:mm', 'rtl' => false, ], @@ -1316,19 +1316,19 @@ 'ko' => [ 'date' => 'yy. M. d.', - 'time' => 'a h:mm', + 'time' => 'h:mm a', 'rtl' => false, ], 'ko_KP' => [ 'date' => 'yy. M. d.', - 'time' => 'a h:mm', + 'time' => 'h:mm a', 'rtl' => false, ], 'ko_KR' => [ 'date' => 'yy. M. d.', - 'time' => 'a h:mm', + 'time' => 'h:mm a', 'rtl' => false, ], 'nb_NO' => @@ -1589,6 +1589,12 @@ 'time' => 'HH:mm', 'rtl' => false, ], + 'uk' => + [ + 'date' => 'dd.MM.yy', + 'time' => 'HH:mm', + 'rtl' => false, + ], 'vi' => [ 'date' => 'dd/MM/y', @@ -1607,4 +1613,10 @@ 'time' => 'HH:mm', 'rtl' => false, ], + 'zh_Hant' => + [ + 'date' => 'y/M/d', + 'time' => 'Bh:mm', + 'rtl' => false, + ], ]; \ No newline at end of file diff --git a/src/Command/RegenerateLocalesCommand.php b/src/Command/RegenerateLocalesCommand.php index 1ed22f4e..783b6677 100644 --- a/src/Command/RegenerateLocalesCommand.php +++ b/src/Command/RegenerateLocalesCommand.php @@ -101,6 +101,14 @@ final class RegenerateLocalesCommand extends Command $settings['date'] = $shortDate->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 $rtlLocale = $locale; if (substr_count($rtlLocale, '_') === 1) {