aboutsummaryrefslogtreecommitdiffstats
path: root/lib/i18n_fixes.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-15 15:19:08 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-15 15:19:08 +1100
commit0bf282eff6912b8a2b03a461b3f62821a8f0cf55 (patch)
tree7e69952da1e8b6326ce778f9b67e2437aa365af3 /lib/i18n_fixes.rb
parent5639dfb4faafb6d25eb219c074d15961ade69645 (diff)
Remove escaping of code in gettext_interpolation because it's not used and not tested
Diffstat (limited to 'lib/i18n_fixes.rb')
-rw-r--r--lib/i18n_fixes.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/i18n_fixes.rb b/lib/i18n_fixes.rb
index 2222fc2f9..7d6ddb80d 100644
--- a/lib/i18n_fixes.rb
+++ b/lib/i18n_fixes.rb
@@ -15,7 +15,7 @@ def _(key, options = {})
end
INTERPOLATION_RESERVED_KEYS = %w(scope default)
-MATCH = /(\\\\)?\{\{([^\}]+)\}\}/
+MATCH = /\{\{([^\}]+)\}\}/
def gettext_interpolate(string, values)
return string unless string.is_a?(String)
@@ -23,11 +23,9 @@ def gettext_interpolate(string, values)
# $1, $2 don't work with SafeBuffer so casting to string as workaround
safe = string.html_safe?
string = string.to_str.gsub(MATCH) do
- escaped, pattern, key = $1, $2, $2.to_sym
+ pattern, key = $1, $1.to_sym
- if escaped
- pattern
- elsif INTERPOLATION_RESERVED_KEYS.include?(pattern)
+ if INTERPOLATION_RESERVED_KEYS.include?(pattern)
raise I18n::ReservedInterpolationKey.new(pattern, string)
elsif !values.include?(key)
raise I18n::MissingInterpolationArgument.new(pattern, string)