Merge pull request #2839 from Elberet/smf2-import

Fix pretty_text translation helper again, this time for real
This commit is contained in:
Robin Ward 2014-10-03 13:13:32 -04:00
commit f2520939b8
1 changed files with 7 additions and 8 deletions

View File

@ -8,16 +8,15 @@ module PrettyText
class Helpers
def t(key, opts)
str = I18n.t("js." + key, opts)
if opts
# TODO: server localisation has no parity with client should be fixed
str = str.dup
opts.each do |k,v|
str.gsub!("{{#{k}}}", v)
key = "js." + key
unless opts
return I18n.t(key)
else
str = I18n.t(key, Hash[opts.entries].symbolize_keys).dup
opts.each {|k,v| str.gsub!("{{#{k.to_s}}}", v.to_s) }
return str
end
end
str
end
# function here are available to v8
def avatar_template(username)