Skip to content

Commit

Permalink
Fall back to en when locale is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
ikapelyukhin committed Apr 19, 2018
1 parent ed62e46 commit 172d4a7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ def set_language
# the short form without underscore
unless LANGUAGES.include? requested_locale
requested_locale = requested_locale.split('_').first
if LANGUAGES.include? requested_locale
params[:locale] = requested_locale
set_gettext_locale
end
params[:locale] = LANGUAGES.include?(requested_locale) ? requested_locale : 'en'
set_gettext_locale
end
@lang = FastGettext.locale
end
Expand Down

0 comments on commit 172d4a7

Please sign in to comment.