FIX: Allow message format translations to be overridden

This commit is contained in:
Robin Ward
2016-04-08 14:49:50 -04:00
parent adb3810f67
commit cc25716e47
9 changed files with 84 additions and 27 deletions

View File

@ -110,14 +110,14 @@ module I18n
by_site = @overrides_by_site[site] = {}
# Load overrides
translations_overrides = TranslationOverride.where(locale: locale).pluck(:translation_key, :value)
translations_overrides = TranslationOverride.where(locale: locale).pluck(:translation_key, :value, :compiled_js)
if translations_overrides.empty?
by_site[locale] = {}
else
translations_overrides.each do |tuple|
by_locale = by_site[locale] ||= {}
by_locale[tuple[0]] = tuple[1]
by_locale[tuple[0]] = tuple[2] || tuple[1]
end
end
end