From 9297325c2797d74aa9516e340d45d425bda85b3b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 23 Oct 2009 06:52:08 -0700 Subject: Minor changes to more closely align this branch with master --- modules/gallery/helpers/locales.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index c2a606cd..2de029ff 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -136,23 +136,6 @@ 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 = identity::active_user()->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. @@ -237,6 +220,23 @@ 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 = identity::active_user()->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); + } + } + static function cookie_locale() { $cookie_data = Input::instance()->cookie("g_locale"); $locale = null; -- cgit v1.2.3