mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +08:00
DEV: Reload current client locale file in development mode
This commit is contained in:
parent
b69e57e2f3
commit
e180e14a55
|
@ -27,12 +27,7 @@ module JsLocaleHelper
|
|||
end
|
||||
end
|
||||
|
||||
def self.load_translations(locale, opts = nil)
|
||||
opts ||= {}
|
||||
|
||||
@loaded_translations = nil if opts[:force]
|
||||
@plugin_translations = nil if opts[:force]
|
||||
|
||||
def self.load_translations(locale)
|
||||
@loaded_translations ||= HashWithIndifferentAccess.new
|
||||
@loaded_translations[locale] ||= begin
|
||||
locale_str = locale.to_s
|
||||
|
@ -115,6 +110,12 @@ module JsLocaleHelper
|
|||
|
||||
I18n.locale = locale_sym
|
||||
|
||||
if Rails.env.development?
|
||||
@loaded_translations = nil
|
||||
@plugin_translations = nil
|
||||
@loaded_merges = nil
|
||||
end
|
||||
|
||||
translations =
|
||||
if locale_sym == :en
|
||||
load_translations(locale_sym)
|
||||
|
|
Loading…
Reference in New Issue
Block a user