aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-26 20:43:35 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-26 20:43:35 +0100
commitdc57d545bb3e8ff4123892e5e311e658ab506252 (patch)
tree8dee5b543ee1830bbe87a38771c9bf1c352a8d72 /actionpack/lib/action_view/helpers
parent9f63c4b26e6afe04849dc906b52177ba5221e3b7 (diff)
downloadrails-dc57d545bb3e8ff4123892e5e311e658ab506252.tar.gz
rails-dc57d545bb3e8ff4123892e5e311e658ab506252.tar.bz2
rails-dc57d545bb3e8ff4123892e5e311e658ab506252.zip
Fix t('.helper').
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/translation_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb
index 35c431d78d..ad18339c60 100644
--- a/actionpack/lib/action_view/helpers/translation_helper.rb
+++ b/actionpack/lib/action_view/helpers/translation_helper.rb
@@ -25,11 +25,15 @@ module ActionView
end
alias :l :localize
-
private
+
def scope_key_by_partial(key)
if key.to_s.first == "."
- template.path_without_format_and_extension.gsub(%r{/_?}, ".") + key.to_s
+ if @_virtual_path
+ @_virtual_path.gsub(%r{/_?}, ".") + key.to_s
+ else
+ raise "Cannot use t(#{key.inspect}) shortcut because path is not available"
+ end
else
key
end