diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-04-24 11:12:54 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-04-24 11:12:54 +0100 |
commit | a5975915975f5f2b815ec1a20e3bcfaf78831add (patch) | |
tree | d09d671e79ae1d3e31cd9234ce835df33c2bd5ea /lib/i18n_fixes.rb | |
parent | a244afcb7b7185905a7a16b37ae585e239e963ea (diff) | |
parent | d3aae5cc48c92473e06b2104bb9431305d5a92f0 (diff) |
Merge branch 'release/0.9' into wdtk
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) |