Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/Intl
diff options
context:
space:
mode:
authorThaDafinser <martin.keckeis@thyssenkrupp.com>2015-09-02 14:57:55 +0300
committerThaDafinser <martin.keckeis@thyssenkrupp.com>2015-09-02 14:57:55 +0300
commitc72f571d3c61f0fb90bbf674eef62bfc516ab796 (patch)
tree46d10d9bdf77196f1b1181a1dbab9123f13f805d /core/Intl
parent1c500b1f2a3fd09051534085c147eb6d15aa56e1 (diff)
fixing Locale on windows + skip
Diffstat (limited to 'core/Intl')
-rw-r--r--core/Intl/Locale.php20
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']);
}
}