FIX: admin strings in plugins should fallback to english when untranslated

This commit is contained in:
Neil Lalonde 2017-11-24 14:11:01 -05:00
parent c2da25dd5c
commit 6f8f2c494d
2 changed files with 5 additions and 3 deletions

View File

@ -48,8 +48,7 @@ function checkExtras(origScope, sep, extras) {
I18n.lookup = function(scope, options) {
options = options || {};
var lookupInitialScope = scope,
translations = this.prepareOptions(I18n.translations),
var translations = this.prepareOptions(I18n.translations),
locale = options.locale || I18n.currentLocale(),
messages = translations[locale] || {},
currentScope;

View File

@ -52,7 +52,10 @@ module JsLocaleHelper
end
# merge translations (plugin translations overwrite default translations)
translations[locale_str]['js'].deep_merge!(plugin_translations(locale_str)['js']) if translations[locale_str] && plugin_translations(locale_str) && plugin_translations(locale_str)['js']
if translations[locale_str] && plugin_translations(locale_str)
translations[locale_str]['js'].deep_merge!(plugin_translations(locale_str)['js']) if plugin_translations(locale_str)['js']
translations[locale_str]['admin_js'].deep_merge!(plugin_translations(locale_str)['admin_js']) if plugin_translations(locale_str)['admin_js']
end
translations
end