aboutsummaryrefslogtreecommitdiffstats
path: root/lib/i18n_fixes.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-04-24 16:01:39 +0100
committerLouise Crow <louise.crow@gmail.com>2013-04-24 16:01:39 +0100
commitd3eec6f983f8524e28e8ffe42ba3a10efaa0a30e (patch)
tree4c9cd3a9709a18a46d179e4af63bc7bcfa117b66 /lib/i18n_fixes.rb
parentcc3da49bc927175a49d7150b98d762f65e143d21 (diff)
parentd3aae5cc48c92473e06b2104bb9431305d5a92f0 (diff)
Merge branch 'release/0.9' into rails-3-develop
Conflicts: Gemfile.lock app/controllers/public_body_controller.rb app/mailers/track_mailer.rb app/views/request/_hidden_correspondence.html.erb app/views/request/_sidebar.html.erb app/views/request/hidden.html.erb app/views/request/new_please_describe.html.erb app/views/request/preview.html.erb app/views/user/show.html.erb config/environment.rb config/routes.rb spec/controllers/public_body_controller_spec.rb
Diffstat (limited to 'lib/i18n_fixes.rb')
-rw-r--r--lib/i18n_fixes.rb11
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)