I have this code:
<tr>
<th><%= _(''Client'') %></th>
<th><%= _(''Product'') %></th>
<th><%= _(''Serial Number'') %></th>
<th><%= _(''State'') %></th>
</tr>
Serial Number is never in my .po file, but the others are there. Where
is the problem?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I can''t see where your problem is. I just ran the code you gave through rgettext and the resulting output was: # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE''S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2008-02-12 22:42+1000\n" "PO-Revision-Date: 2008-02-12 22:42+1000\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL-2l5V8CiXCHs@public.gmane.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: /Users/stuart/test.rhtml:2 msgid "Client" msgstr "" #: /Users/stuart/test.rhtml:3 msgid "Product" msgstr "" #: /Users/stuart/test.rhtml:4 msgid "Serial Number" msgstr "" #: /Users/stuart/test.rhtml:5 msgid "State" msgstr "" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
stuart.coyle wrote:> I can''t see where your problem is. > I just ran the code you gave through rgettext and the resulting output > was: > > # SOME DESCRIPTIVE TITLE. > # Copyright (C) YEAR THE PACKAGE''S COPYRIGHT HOLDER > # This file is distributed under the same license as the PACKAGE > package. > # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. > # > #, fuzzy > msgid "" > msgstr "" > "Project-Id-Version: PACKAGE VERSION\n" > "POT-Creation-Date: 2008-02-12 22:42+1000\n" > "PO-Revision-Date: 2008-02-12 22:42+1000\n" > "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" > "Language-Team: LANGUAGE <LL-2l5V8CiXCHs@public.gmane.org>\n" > "MIME-Version: 1.0\n" > "Content-Type: text/plain; charset=UTF-8\n" > "Content-Transfer-Encoding: 8bit\n" > "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" > > #: /Users/stuart/test.rhtml:2 > msgid "Client" > msgstr "" > > #: /Users/stuart/test.rhtml:3 > msgid "Product" > msgstr "" > > #: /Users/stuart/test.rhtml:4 > msgid "Serial Number" > msgstr "" > > #: /Users/stuart/test.rhtml:5 > msgid "State" > msgstr ""Thanks. I think it must be some kind of problem with my rails and my gettext version. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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 Smith
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:>
>
> 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)
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
Jaime Iniesta
http://jaimeiniesta.com - http://railes.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---