diff options
Diffstat (limited to 'modules/gallery/helpers/locales.php')
| -rw-r--r-- | modules/gallery/helpers/locales.php | 34 | 
1 files changed, 17 insertions, 17 deletions
| diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index f0807c99..2cd8b0c2 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -136,6 +136,23 @@ class locales_Core {      return in_array($language, array("he", "fa", "ar"));    } +  static function set_request_locale() { +    // 1. Check the session specific preference (cookie) +    $locale = self::cookie_locale(); +    // 2. Check the user's preference +    if (!$locale) { +      $locale = user::active()->locale; +    } +    // 3. Check the browser's / OS' preference +    if (!$locale) { +      $locale = self::locale_from_http_request(); +    } +    // If we have any preference, override the site's default locale +    if ($locale) { +      I18n::instance()->locale($locale); +    } +  } +    /**     * Returns the best match comparing the HTTP accept-language header     * with the installed locales. @@ -220,23 +237,6 @@ class locales_Core {      return array(null, 0);    } -  static function set_request_locale() { -    // 1. Check the session specific preference (cookie) -    $locale = self::cookie_locale(); -    // 2. Check the user's preference -    if (!$locale) { -      $locale = user::active()->locale; -    } -    // 3. Check the browser's / OS' preference -    if (!$locale) { -      $locale = locales::locale_from_http_request(); -    } -    // If we have any preference, override the site's default locale -    if ($locale) { -      I18n::instance()->locale($locale); -    } -  } -    static function cookie_locale() {      $cookie_data = Input::instance()->cookie("g_locale");      $locale = null; | 
