mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 15:40:12 +08:00
Safety in case translations are missing root keys
This commit is contained in:
parent
5d445fb810
commit
e0096b0d1c
@ -55,6 +55,10 @@ module JsLocaleHelper
|
||||
|
||||
# merge translations (plugin translations overwrite default translations)
|
||||
if translations[locale_str] && plugin_translations(locale_str)
|
||||
translations[locale_str]['js'] ||= {}
|
||||
translations[locale_str]['admin_js'] ||= {}
|
||||
translations[locale_str]['wizard_js'] ||= {}
|
||||
|
||||
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']
|
||||
translations[locale_str]['wizard_js'].deep_merge!(plugin_translations(locale_str)['wizard_js']) if plugin_translations(locale_str)['wizard_js']
|
||||
|
Loading…
x
Reference in New Issue
Block a user