From 696948f6c122bce68db3895b8a878c1e707d11d6 Mon Sep 17 00:00:00 2001 From: sunil Date: Thu, 7 Apr 2016 23:24:16 +0530 Subject: [PATCH] CRM-18362 get current local for navigation menu --- CRM/Core/I18n.php | 10 ++++++++++ CRM/Core/Smarty/plugins/function.crmNavigationMenu.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index f90967c6ba..8748bc8337 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -542,6 +542,16 @@ class CRM_Core_I18n { return $locales[$tsLocale]; } + /** + * Get the current locale + * + * @return string + */ + public static function getLocale() { + global $tsLocale; + return $tsLocale; + } + } /** diff --git a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php index b86449df27..b8dcb916fb 100644 --- a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php +++ b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php @@ -61,7 +61,7 @@ function smarty_function_crmNavigationMenu($params, &$smarty) { // These params force the browser to refresh the js file when switching user, domain, or language // We don't put them as a query string because some browsers will refuse to cache a page with a ? in the url // @see CRM_Admin_Page_AJAX::getNavigationMenu - $lang = $config->lcMessages; + $lang = CRM_Core_I18n::getLocale(); $domain = CRM_Core_Config::domainID(); $key = CRM_Core_BAO_Navigation::getCacheKey($contactID); $src = CRM_Utils_System::url("civicrm/ajax/menujs/$contactID/$lang/$domain/$key"); -- 2.25.1