FIX: plugin translations overwrite each other

This commit is contained in:
Neil Lalonde 2014-02-19 17:16:26 -05:00
parent 2d398903c0
commit ac8203b601

View file

@ -8,7 +8,7 @@ module JsLocaleHelper
# load plugins translations
plugin_translations = {}
Dir["#{Rails.root}/plugins/*/config/locales/client.#{locale_str}.yml"].each do |file|
plugin_translations.merge! YAML::load(File.open(file))
plugin_translations.deep_merge! YAML::load(File.open(file))
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']