# Parse haml for gettext: RubyLex Error

**URL:** <https://www.ruby-forum.com/t/parse-haml-for-gettext-rubylex-error/143017>\
**Category:** Rails I18n\
**Created:** [July 14, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/parse-haml-for-gettext-rubylex-error/143017 "2008-07-14T15:35:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@benni](https://www.ruby-forum.com/u/benni)\
**Post date:** [July 14, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/parse-haml-for-gettext-rubylex-error/143017/1 "2008-07-14T15:35:25Z")

</div>

hey

I would like to bring the newest versions of haml(2.0.1), rails(2.1.0)  
and gettext(1.91.0) in my current project together. But in the moment, I  
failure on parsing the haml-files to update my po-files. This is the  
error message:

~/dev/GettextTest$ rake updatepo  
Error: #\<RubyLex::SyntaxError: unknown type of %string\>

# the rake task

desc “Update pot/po files.”  
task :updatepo do  
require ‘gettext/utils’  
GetText.update\_pofiles(“blog”,  
Dir.glob("{app,lib,bin}/\*\*/\*.{rb,erb,rjs,haml}"), “blog 1.0.0”)  
end

# and the haml-parser

require ‘gettext/rgettext’  
module HamlParser  
module\_function

def target?(file)  
File.extname(file) == “.haml”  
end

def parse(file, ary = [])  
haml = Haml::Engine.new(IO.readlines(file).join)  
code = haml.precompiled.split(/$/)  
RubyParser.parse\_lines(file, code, ary)  
end  
end  
GetText::RGetText.add\_parser(HamlParser)

Any idas how to fix it?

thanks in advance,  
Benni
