CRM-18362 get current local for navigation menu
authorsunil <esunil.pawar@gmail.com>
Thu, 7 Apr 2016 18:00:51 +0000 (23:30 +0530)
committersunil <esunil.pawar@gmail.com>
Thu, 7 Apr 2016 18:00:51 +0000 (23:30 +0530)
CRM/Core/I18n.php
CRM/Core/Smarty/plugins/function.crmNavigationMenu.php

index 67960dff0cc0e848180d54298ce9a833d8e5447d..94d8ed6272b1be430fb6aef5738a488ce2d8ed6b 100644 (file)
@@ -670,6 +670,16 @@ class CRM_Core_I18n {
     return $language;
   }
 
+  /**
+   * Get the current locale
+   *
+   * @return string
+   */
+  public static function getLocale() {
+    global $tsLocale;
+    return $tsLocale;
+  }
+
 }
 
 /**
index 32da5f8efd5368b6fa93b2dc1545e21ff1f9b240..5cc4b2306fe43535a6038cc2173b6d67b42c6923 100644 (file)
@@ -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");