CRM-18362 Fixed issue with redeclare setLocale function
authorsunil <esunil.pawar@gmail.com>
Wed, 13 Apr 2016 13:33:54 +0000 (19:03 +0530)
committersunil <esunil.pawar@gmail.com>
Wed, 13 Apr 2016 13:33:54 +0000 (19:03 +0530)
CRM/Core/I18n.php

index 5396e9e19ceaec7b4cdc0b4bdea3c54235f47cc8..e473104917b5cf4ae837d25b0ae7ace61cbcbd7f 100644 (file)
@@ -565,7 +565,7 @@ class CRM_Core_I18n {
    *   Language (for example 'en_US', or 'fr_CA').
    *   True if the domain was changed for an extension.
    */
-  public function setLocale($language) {
+  public static function setLocale($language) {
 
     $config = CRM_Core_Config::singleton();
 
@@ -602,8 +602,9 @@ class CRM_Core_I18n {
     }
 
     // for sql queries
-    global $dbLocale;
+    global $dbLocale, $tsLocale;
     $dbLocale = "_{$language}";
+    $tsLocale = $language;
 
   }
 
@@ -679,15 +680,6 @@ class CRM_Core_I18n {
     return $tsLocale;
   }
 
-  /**
-   * Set the current locale
-   * @param $locale
-   */
-  public static function setLocale($locale) {
-    global $tsLocale;
-    $tsLocale = $locale;
-  }
-
 }
 
 /**