diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-04-24 15:20:14 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-04-24 15:20:14 +0100 |
commit | 7195e67e525af76f264e278e22a2784040c45d46 (patch) | |
tree | 5825044ec29145b95b61fe781113b1046ca6c4ce /lib/i18n_fixes.rb | |
parent | 4929b1e738d15d2178e131701027ef20492599d9 (diff) | |
parent | d3aae5cc48c92473e06b2104bb9431305d5a92f0 (diff) |
Merge branch 'release/0.9'0.9
Conflicts:
locale/cs/app.po
locale/he_IL/app.po
locale/id/app.po
locale/it/app.po
locale/ro_RO/app.po
locale/uk/app.po
Diffstat (limited to 'lib/i18n_fixes.rb')
-rw-r--r-- | lib/i18n_fixes.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/i18n_fixes.rb b/lib/i18n_fixes.rb index a85faddcb..82d1b2c3a 100644 --- a/lib/i18n_fixes.rb +++ b/lib/i18n_fixes.rb @@ -14,6 +14,17 @@ def _(key, options = {}) gettext_interpolate(translation, options) end +def n_(*keys) + # The last parameter should be the values to do the interpolation with + if keys.count > 3 + options = keys.pop + else + options = {} + end + translation = FastGettext.n_(*keys).html_safe + gettext_interpolate(translation, options) +end + MATCH = /\{\{([^\}]+)\}\}/ def gettext_interpolate(string, values) |