From: sunil Date: Thu, 7 Apr 2016 18:00:51 +0000 (+0530) Subject: CRM-18362 get current local for navigation menu X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=186e53b35f54504ad7dc3e0b2544ac29e132aaf4;p=civicrm-core.git CRM-18362 get current local for navigation menu --- 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");