activeadmin-selleo-cms 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,12 @@
|
|
1
1
|
class CmsController < ApplicationController
|
2
2
|
|
3
3
|
before_filter do
|
4
|
-
set_locale(params[:locale])
|
5
4
|
@available_locales = ActiveadminSelleoCms::Locale.enabled
|
5
|
+
set_locale(params[:locale])
|
6
6
|
end
|
7
7
|
|
8
|
-
def set_locale(locale_code
|
9
|
-
I18n.locale = locale_code
|
8
|
+
def set_locale(locale_code)
|
9
|
+
I18n.locale = @available_locales.map(&:code).include?(locale_code.to_s.to_sym) ? locale_code : I18n.default_locale
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|