Method: ApplicationHelper#i18ns
- Defined in:
- app/helpers/application_helper.rb
#i18ns(key, **subs) ⇒ String
Translate a given string using I18n#t, after substituting values into the string based on a hash.
259 260 261 262 263 264 265 |
# File 'app/helpers/application_helper.rb', line 259 def i18ns(key, **subs) s = I18n.t key subs.each do |f, r| s = s.gsub ":#{f}", r.to_s end s end |