diff options
Diffstat (limited to 'core/Translate.php')
-rw-r--r-- | core/Translate.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/Translate.php b/core/Translate.php index 73cd53c92e..84c46f38da 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -27,7 +27,8 @@ class Translate */ public static function clean($s) { - return html_entity_decode(trim($s), ENT_QUOTES, 'UTF-8'); + self::triggerDeprecationNotice(); + return self::getTranslator()->clean($s); } /** @@ -51,6 +52,7 @@ class Translate */ public static function reloadLanguage($language = false) { + self::triggerDeprecationNotice(); } /** @@ -61,6 +63,7 @@ class Translate */ public static function loadCoreTranslation($language = false) { + self::triggerDeprecationNotice(); self::getTranslator()->addDirectory(PIWIK_INCLUDE_PATH . '/lang'); } @@ -69,6 +72,7 @@ class Translate */ public static function mergeTranslationArray($translation) { + self::triggerDeprecationNotice(); } /** @@ -77,12 +81,14 @@ class Translate */ public static function getLanguageToLoad() { + self::triggerDeprecationNotice(); return self::getTranslator()->getCurrentLanguage(); } /** Reset the cached language to load. Used in tests. */ public static function reset() { + self::triggerDeprecationNotice(); self::getTranslator()->reset(); } @@ -92,11 +98,13 @@ class Translate */ public static function getLanguageLoaded() { + self::triggerDeprecationNotice(); return self::getTranslator()->getCurrentLanguage(); } public static function getLanguageDefault() { + self::triggerDeprecationNotice(); return self::getTranslator()->getDefaultLanguage(); } @@ -105,11 +113,13 @@ class Translate */ public static function getJavascriptTranslations() { + self::triggerDeprecationNotice(); return self::getTranslator()->getJavascriptTranslations(); } public static function findTranslationKeyForTranslation($translation) { + self::triggerDeprecationNotice(); return self::getTranslator()->findTranslationKeyForTranslation($translation); } @@ -123,7 +133,15 @@ class Translate public static function loadAllTranslations() { + self::triggerDeprecationNotice(); self::loadCoreTranslation(); Manager::getInstance()->loadPluginTranslations(); } + + protected static function triggerDeprecationNotice() + { + if (Development::isEnabled()) { + Log::warning('Using \Piwik\Translate is deprecated. Use \Piwik\Translation\Translator instead.'); + } + } } |