diff options
author | sgiehl <stefan@piwik.org> | 2013-09-15 01:45:35 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2013-09-15 01:45:35 +0400 |
commit | fd18ea20bc24cfa5a12a625370bca1fbe9339464 (patch) | |
tree | 198b6a50e23ddde088c969a7255b8a28db15fe64 /core/Translate.php | |
parent | aa6bef276caf3390c2a2a8cf8aced6a8e4eb94f9 (diff) |
fixes #4151 removed _js hack
Diffstat (limited to 'core/Translate.php')
-rw-r--r-- | core/Translate.php | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/core/Translate.php b/core/Translate.php index c36410f505..179cc1be31 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -163,10 +163,6 @@ class Translate { $translations = &$GLOBALS['Piwik_translations']; - // Hack: common translations used in JS but not only, force them to be defined in JS - $translations['General']['Save_js'] = $translations['General']['Save']; - $translations['General']['OrCancel_js'] = $translations['General']['OrCancel']; - $clientSideTranslations = array(); foreach ($this->getClientSideTranslationKeys() as $key) { list($plugin, $stringName) = explode("_", $key, 2); @@ -178,7 +174,7 @@ class Translate 'for(var i in translations) { piwik_translations[i] = translations[i];} '; $js .= 'function _pk_translate(translationStringId) { ' . 'if( typeof(piwik_translations[translationStringId]) != \'undefined\' ){ return piwik_translations[translationStringId]; }' . - 'return "The string "+translationStringId+" was not loaded in javascript. Make sure it is suffixed with _js.";}'; + 'return "The string "+translationStringId+" was not loaded in javascript. Make sure it is added in the Translate.getClientSideTranslationKeys hook.";}'; return $js; } @@ -194,15 +190,7 @@ class Translate Piwik_PostEvent(self::GET_CLIENT_SIDE_TRANSLATION_KEYS_EVENT, array(&$result)); - $translations = $GLOBALS['Piwik_translations']; - foreach ($translations as $module => $keys) { - foreach($keys as $key => $value) { - // Find keys ending with _js - if (preg_match($moduleRegex, $key)) { - $result[] = $module . '_' . $key; - } - } - } + $result = array_unique($result); return $result; } |