Hi Malte,
the directory in which ruby-gettext creates the .mo files should be
the right directory.
If I convert the po-file from
APP_ROOT/po/xxx.pot
APP_ROOT/po/<tag>/xxx.po
ruby-gettext creates an mo-file in
APP_ROOT/locale/<tag>/LC_MESSAGES/rails.mo
(where tag is like de_DE or en_GB).
And it works fine.
Here is my rakefile:
require 'gettext/utils'
namespace:gettext do
desc "Update pot/po files to match new version."
task :updatepo do
GetText.update_pofiles("de", Dir.glob("app/**/*.{rb,rhtml}"),
"xxx 1.0")
end
desc "Create mo-files for L10n"
task :makemo do
GetText.create_mofiles(true, "po", "locale", "%s/LC_MESSAGES")
end
end
rake gettext:updatepo
rake gettext:makemo
Don't forget to insert
init_gettext "rails"
into your ApplicationController.
You can also add a path using:
add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo")
May that helps.
Am 03.12.2006 um 11:45 schrieb Malte M.:
> I'm glad that I found this list. Trying my first steps
> with Rails, I found out that ruby-gettext is best suited
> for my i18n needs. There's one problem, though:
>
> I've done a first rough custom translation of rails.po.
> (The language I need is not shipped with ruby-gettext).
> It works fine if I install the corresponding rails.mo
> file into a system locale directory, i.e., into
> /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/eo.
>
> However, I suppose that my webspace provider won't put
> a file into a system directory only for me. So I tried
> to put the file into RAILS_ROOT/locale/eo. But as it turns
> out, ruby-gettext is not interested in the file if I put
> it there.
>
> Any hints?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Railsi18n-discussion mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/railsi18n-discussion
>
---
Thomas Baustert
b-simple.de - Ruby on Rails, Java EE, Entwicklung, Coaching
fon: +49(40)411 622 35 mobil: +49(173)23 911 43
fax: +49(40)411 622 36 email: thomas.baustert(at)b-simple.de
_______________________________________________
Railsi18n-discussion mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/railsi18n-discussion