diff options
author | ThaDafinser <martin.keckeis@thyssenkrupp.com> | 2015-09-02 14:57:55 +0300 |
---|---|---|
committer | ThaDafinser <martin.keckeis@thyssenkrupp.com> | 2015-09-02 14:57:55 +0300 |
commit | c72f571d3c61f0fb90bbf674eef62bfc516ab796 (patch) | |
tree | 46d10d9bdf77196f1b1181a1dbab9123f13f805d /core/Intl | |
parent | 1c500b1f2a3fd09051534085c147eb6d15aa56e1 (diff) |
fixing Locale on windows + skip
Diffstat (limited to 'core/Intl')
-rw-r--r-- | core/Intl/Locale.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/core/Intl/Locale.php b/core/Intl/Locale.php index 5b284d5a97..5ff2329d97 100644 --- a/core/Intl/Locale.php +++ b/core/Intl/Locale.php @@ -12,14 +12,26 @@ class Locale { public static function setLocale($locale) { - $localeVariant = str_replace('UTF-8', 'UTF8', $locale); - - setlocale(LC_ALL, $locale, $localeVariant); + if(!is_array($locale)){ + $locale = array($locale); + } + + $newLocale = array(); + foreach($locale as $localePart){ + $newLocale[] = $localePart; + + $localeVariant = str_replace('UTF-8', 'UTF8', $localePart); + if($localeVariant != $localePart){ + $newLocale[] = $localeVariant; + } + } + + setlocale(LC_ALL, $newLocale); setlocale(LC_CTYPE, ''); } public static function setDefaultLocale() { - self::setLocale('en_US.UTF-8'); + self::setLocale(['en_US.UTF-8', 'en-US']); } } |