Javascript I18n: fallback to DEFAULT_LANGUAGE for missing keys
This commit is contained in:
parent
15329af94d
commit
7ca8391739
2 changed files with 3 additions and 5 deletions
|
|
@ -48,8 +48,4 @@ class ApplicationController < ActionController::Base
|
|||
I18n.locale = request.compatible_language_from AVAILABLE_LANGUAGE_CODES
|
||||
end
|
||||
end
|
||||
|
||||
def get_javascript_strings_for(language)
|
||||
Il8n.t('javascripts').to_json
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -272,6 +272,8 @@ module ApplicationHelper
|
|||
|
||||
|
||||
def get_javascript_strings_for(language)
|
||||
I18n.t('javascripts')
|
||||
translations = I18n.t('javascripts', :locale => language)
|
||||
defaults = I18n.t('javascripts', :locale => DEFAULT_LANGUAGE)
|
||||
defaults.update(translations)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue