Added extra setlocale format to help windows support

Related to #3650
This commit is contained in:
Dan Brown 2022-09-20 11:59:36 +01:00
parent 0cc68b7665
commit 050d69ea27
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9

View file

@ -116,12 +116,14 @@ class LanguageManager
*/
public function setPhpDateTimeLocale(string $language): void
{
$isoLang = $this->localeMap[$language]['iso'] ?? false;
$isoLang = $this->localeMap[$language]['iso'] ?? '';
$isoLangPrefix = explode('_', $isoLang)[0];
$locales = array_filter([
$isoLang ? $isoLang . '.utf8' : false,
$isoLang ?: false,
$isoLang ? str_replace('_', '-', $isoLang) : false,
$isoLang ? $isoLangPrefix . '.UTF-8' : false,
$this->localeMap[$language]['windows'] ?? false,
$language,
]);