mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Allow plugins to register a new locale
This commit is contained in:
@ -39,6 +39,13 @@ module I18n
|
||||
if @loaded_locales.empty?
|
||||
# load all rb files
|
||||
I18n.backend.load_translations(I18n.load_path.grep(/\.rb$/))
|
||||
|
||||
# load plural rules from plugins
|
||||
DiscoursePluginRegistry.locales.each do |locale, options|
|
||||
if options[:plural]
|
||||
I18n.backend.store_translations(locale, i18n: { plural: options[:plural] })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# load it
|
||||
|
Reference in New Issue
Block a user