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
diff options
context:
space:
mode:
Diffstat (limited to 'core/Intl/Locale.php')
-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');
+ }
+}