mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:38:47 +08:00
PERF: stop messing with strings that come back from I18n.t
allows better caching
This commit is contained in:
@ -16,10 +16,10 @@ module I18n
|
||||
k = [args,config.locale,config.backend.object_id]
|
||||
t = @cache.fetch(k){found=false}
|
||||
unless found
|
||||
t = @cache[k] = translate_no_cache(*args)
|
||||
t = @cache[k] = translate_no_cache(*args).freeze
|
||||
end
|
||||
|
||||
t.dup
|
||||
t
|
||||
end
|
||||
|
||||
alias_method :t, :translate
|
||||
|
Reference in New Issue
Block a user