Permalink
Browse files

latest haml 3.1 update

  • Loading branch information...
1 parent aee9de6 commit 09668e1038a8326955fe256c98890b0e7b5f8455 @cail committed Jun 15, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 init.rb
View
@@ -69,25 +69,25 @@ def have_translation(key)
#
# Inject translate into plain text and tag plain text calls
#
- def push_plain(text)
+ def plain(text)
if have_translation(text)
- push_script "translate('#{text.gsub(/'/, '\\\'')}')"
+ script "translate('#{text.gsub(/'/, '\\\'')}')"
else
super(text)
end
end
def parse_tag(line)
- tag_name, attributes, attributes_hash, object_ref, nuke_outer_whitespace,
- nuke_inner_whitespace, action, value = super(line)
+ tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
+ nuke_inner_whitespace, action, value, last_line = super(line)
if !action and !value.empty? and have_translation(value)
action = '='
value = "translate('#{value.gsub(/'/, '\\\'')}')"
end
- [tag_name, attributes, attributes_hash, object_ref, nuke_outer_whitespace,
- nuke_inner_whitespace, action, value]
+ [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
+ nuke_inner_whitespace, action, value, last_line]
end
end
end

0 comments on commit 09668e1

Please sign in to comment.