From 66522c4a2c701a83827f97dd9f81f4be2ff63454 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Mon, 3 Jun 2013 22:46:52 +0200 Subject: [PATCH] // Add translate() as deprecated --- admin-dev/functions.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/admin-dev/functions.php b/admin-dev/functions.php index dd5dea623..62db43b39 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -223,6 +223,24 @@ function checkPSVersion() return $upgrader->checkPSVersion(); } +/** + * Deprecated since > 1.5.4.1 + * Use Translate::getAdminTranslation($string) instead + * + * @param string $string + */ +function translate($string) +{ + Tools::displayAsDeprecated(); + + global $_LANGADM; + if (!is_array($_LANGADM)) + return str_replace('"', '"', $string); + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : ((key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : $string); + return str_replace('"', '"', stripslashes($str)); +} + /** * Returns a new Tab object *