Help with Gettext

I have .rhtml.erb files to use Gettext with them, but it doesn’t wok
always with all the <%= _(’ ') %> text. Why?

My rakefile has that:

desc “Update po/pot files”
task :updatepo do
MY_APP_DOMAIN = “prob”
MY_APP_VERSION = “1.0”
GetText.update_pofiles(MY_APP_DOMAIN,
Dir.glob("{app,lib}/**/*.{rb,html.erb}"),
MY_APP_VERSION)

Hi John, maybe you’re using .rhtml files? I mean, instead of .html.erb.

To make your rake task find translatable strings on .rhtml as well,
change
this line:

                     Dir.glob("{app,lib}/**/*.{rb,html.erb}"),

to:

                     Dir.glob("{app,lib}/**/*.{rb,rhtml,erb}"),

Here goes my localization.rake:
################################
require ‘gettext/utils’
desc “Create mo-files”
task :makemo do
GetText.create_mofiles(true, “po”, “locale”)
end

desc “Update pot/po files to match new version.”
task :updatepo do
TEXT_DOMAIN = “myapp”
APP_VERSION = “myapp 1.1.0”
GetText.update_pofiles(TEXT_DOMAIN,
Dir.glob(“{app,lib}/**/*.{rb,rhtml,erb}”),
APP_VERSION)
end
################################

Hope this helps!
Jaime

2008/2/17, John S. [email protected]:

MY_APP_VERSION = “1.0”
GetText.update_pofiles(MY_APP_DOMAIN,
Dir.glob(“{app,lib}/**/*.{rb,html.erb}”),
MY_APP_VERSION)

Posted via http://www.ruby-forum.com/.


Jaime I.
http://jaimeiniesta.com - http://railes.net