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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-12-30 02:32:32 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-01-05 05:25:11 +0300
commitea9c95410a436cea3051ab813476c24b4ddaca0d (patch)
tree2ba9b6e9904d7046b4dc08c34dea5205cf5c5627 /core/Intl
parentde06fd66ee7d01832ff08f13d58e21a9d7a510c7 (diff)
Fix unit tests by loading no translations by default in tests
Diffstat (limited to 'core/Intl')
-rw-r--r--core/Intl/Locale.php19
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');
+ }
+}