localyzed 0.0.2.8 → 0.0.2.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
|
|
1
1
|
module LocalizedController
|
2
|
+
def self.included(base)
|
3
|
+
base.send :before_filter :set_locale
|
4
|
+
# redirects_to localized path if path not loaclized and request not ajax or api
|
5
|
+
base.send :before_filter, :redirect_to_localized_path_if
|
6
|
+
end
|
2
7
|
|
3
8
|
def url_options
|
4
9
|
{:locale => I18n.locale.to_s}.merge(super)
|
5
10
|
end
|
6
11
|
|
7
|
-
before_filter :set_locale
|
8
|
-
|
9
|
-
# redirects_to localized path if path not loaclized and request not ajax or api
|
10
|
-
before_filter :redirect_to_localized_path_if
|
11
|
-
|
12
12
|
# sets the locale by checking user data then request param then session data then retrieving accept language data
|
13
13
|
def set_locale
|
14
14
|
if user_signed_in? and cl = (current_user.respond_to?(:language) ? current_user.language : 'en') and I18n.available_locales.include?(cl)
|
data/lib/localyzed/version.rb
CHANGED