Hi,
On Sun, 3 Dec 2006 15:15:00 +0100
"Malte M." <[EMAIL PROTECTED]> wrote:
> Moin Thomas, thanks for your reply. I'm afraid your advice did
> not really help me. Maybe I should try and state the point of
> my problem clearer.
>
> Thomas Baustert wrote:
> > Don't forget to insert
> >
> > init_gettext "rails"
> >
> > into your ApplicationController.
>
> Basically, Gettext is working for me (translating e.g. table
> names), which means that I have done this already. The thing
> which does not work is only related to my rails.mo file,
> generated from rails.po. This is po/rails.pot in the ruby-
> gettext source directory. It contains default messages for
> rails à la "%{num} errors prohibited this %{record} from being
> saved".
>
> > You can also add a path using:
> >
> > add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo")
>
> Actually, when the application is running, the path is set right:
>
> $ ls locale/eo/LC_MESSAGES/
> eventoj.mo rails.mo
>
> $ ./script/console
> Loading development environment.
> irb> ApplicationController.add_default_locale_path 'foo'
> => ["foo",
> "/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo",
> "/usr/share/locale/%{locale}/LC_MESSAGES/%{name}.mo",
> "/usr/local/share/locale/%{locale}/LC_MESSAGES/%{name}.mo"]
>
> But it seems that these directories are not searched for rails.mo.
> (Note that it works for eventoj.mo, the mo file for my application.)
> Instead, rails.mo is in (for me)
> /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/*/LC_MESSAGES,
> and found therein. My problem is that I do not want to put my custom
> translation there, but do not understand how to tell Gettext that it
> is somewhere else.
>
> Hope we'll get this done.
The GetText.add_default_locale_path methods should be called before
bindtextomain "rails".
It means, you need to call it before requiring 'gettext/rails'.
How about adding this code to the bottom of environment.rb(though I don't test
it) ?:
environment.rb:
-----
require 'gettext'
GetText.add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo")
require 'gettext/rails'
-----
BTW, I think the best way to support your language is
to include your language in Ruby-GetText-Package.
If you help me, I can include your language to my official package.
#Ask me directly if you are interested in it.
Regards,
Masao.
_______________________________________________
Railsi18n-discussion mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/railsi18n-discussion