From 186e53b35f54504ad7dc3e0b2544ac29e132aaf4 Mon Sep 17 00:00:00 2001 From: sunil Date: Thu, 7 Apr 2016 23:30:51 +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 67960dff0c..94d8ed6272 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -670,6 +670,16 @@ class CRM_Core_I18n { return $language; } + /** + * 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 32da5f8efd..5cc4b2306f 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