I succeeded localizing my app with gettext (good tutorial @
http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html) BUT… I’d
like to localize an engine (let’s call it jdoe_engine…
it seems more complicated…
In order to get my pot/po’s to generate my mo’s
what should be my rakefile ? where it should be located ? how can I run
it ? any additional lines to be inserted into my app files to take my
mo’s in account ?
could google it anywhere …
masao wrote that , but I don’t actually got it right :
Rails Plugins
You can localized your Rails Plugins easily.
require ‘gettext/rails’
module FooPlugin
include GetText::Rails
bindtextdomain(“foo_plugin”, :path => File.join(RAILS_ROOT,
“vendor/plugins/foo/locale”))
:
:
end
In this example, the FooPlugin module binds “foo_plugin” textdomain.
And the mo files are in
vendor/plugins/foo/locale/#{lang}/LC_MESSGES/foo_plugin.mo.
If you want to use the same textdomain with the application, you can use
ActionController::Base.textdomainname.