diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-30 02:32:32 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-05 05:25:11 +0300 |
commit | ea9c95410a436cea3051ab813476c24b4ddaca0d (patch) | |
tree | 2ba9b6e9904d7046b4dc08c34dea5205cf5c5627 /core/Intl | |
parent | de06fd66ee7d01832ff08f13d58e21a9d7a510c7 (diff) |
Fix unit tests by loading no translations by default in tests
Diffstat (limited to 'core/Intl')
-rw-r--r-- | core/Intl/Locale.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/Intl/Locale.php b/core/Intl/Locale.php new file mode 100644 index 0000000000..7c18b727c5 --- /dev/null +++ b/core/Intl/Locale.php @@ -0,0 +1,19 @@ +<?php + +namespace Piwik\Intl; + +class Locale +{ + public static function setLocale($locale) + { + $localeVariant = str_replace('UTF-8', 'UTF8', $locale); + + setlocale(LC_ALL, $locale, $localeVariant); + setlocale(LC_CTYPE, ''); + } + + public static function setDefaultLocale() + { + self::setLocale('en_US.UTF-8'); + } +} |