Javascript I18n: fallback to DEFAULT_LANGUAGE for missing keys

This commit is contained in:
MrZYX 2011-02-01 22:43:46 +01:00
parent 15329af94d
commit 7ca8391739
2 changed files with 3 additions and 5 deletions

View file

@ -48,8 +48,4 @@ class ApplicationController < ActionController::Base
I18n.locale = request.compatible_language_from AVAILABLE_LANGUAGE_CODES I18n.locale = request.compatible_language_from AVAILABLE_LANGUAGE_CODES
end end
end end
def get_javascript_strings_for(language)
Il8n.t('javascripts').to_json
end
end end

View file

@ -272,6 +272,8 @@ module ApplicationHelper
def get_javascript_strings_for(language) 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
end end