Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

latest haml 3.1 update

  • Loading branch information...
commit 09668e1038a8326955fe256c98890b0e7b5f8455 1 parent aee9de6
@cail authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 init.rb
View
12 init.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.