FIX: Ensure that the right locale exists before merging.
This commit is contained in:
parent
1c3992e575
commit
ccd75cf987
|
@ -7,7 +7,9 @@ module JsLocaleHelper
|
||||||
translations = {}
|
translations = {}
|
||||||
|
|
||||||
Dir["#{Rails.root}/plugins/*/config/locales/client.#{locale_str}.yml"].each do |file|
|
Dir["#{Rails.root}/plugins/*/config/locales/client.#{locale_str}.yml"].each do |file|
|
||||||
translations.deep_merge! YAML::load(File.open(file))[locale_str]
|
if plugin_translations = YAML::load(File.open(file))[locale_str]
|
||||||
|
translations.deep_merge!(plugin_translations)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
translations
|
translations
|
||||||
|
|
Loading…
Reference in New Issue