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:
authorPatryk Andrzejewski <p.andrzejewski@clearcode.cc>2014-09-11 17:51:46 +0400
committerPatryk Andrzejewski <p.andrzejewski@clearcode.cc>2014-09-11 17:51:46 +0400
commit6544dff7804edfdbf2fcc6c50fc2f3e42398e9eb (patch)
treec2ef680c10c7193e4fc78acf5862928c15135482 /plugins/UserSettings/functions.php
parent58154e453834d1b3d1113ad1aef923a73154f631 (diff)
resolve piwik/piwik#6097, modify browser language reporting
Diffstat (limited to 'plugins/UserSettings/functions.php')
-rwxr-xr-x[-rw-r--r--]plugins/UserSettings/functions.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/UserSettings/functions.php b/plugins/UserSettings/functions.php
index ad5deec648..4f2fa1b648 100644..100755
--- a/plugins/UserSettings/functions.php
+++ b/plugins/UserSettings/functions.php
@@ -266,3 +266,35 @@ function languageTranslate($label)
return $translation;
}
+
+/**
+ * @param $label
+ * @return string
+ */
+function languageTranslateWithCode($label)
+{
+
+ $ex = explode('-', $label);
+
+ $lang = languageTranslate($ex[0]);
+
+ $countryKey = 'UserCountry_country_' . $ex[1];
+
+ $country = Piwik::translate($countryKey);
+
+ if ($country == $countryKey) {
+ $country = 'Unknown';
+ }
+
+ return $lang . ' - ' . $country . ' - (' . $label . ')';
+}
+
+/**
+ * @param $lang
+ * @return mixed
+ */
+function groupByLangCallback($lang)
+{
+ $ex = explode('-', $lang);
+ return $ex[0];
+} \ No newline at end of file