I recently converted a large Rails 3 application into a gem. Localization
is part of the original code base.
I modified the *gettext:find* task to look in the gem and in any app that
uses the gem to find potential translations.
namespace :gettext do
def files_to_translate
files_in_application + files_in_gem
end
def files_in_application
Dir.glob(glob_pattern)
end
def files_in_gem
Dir.glob(File.join(MyGem.root, glob_pattern))
end
def glob_pattern
"{app,lib,config,locale}/**/*.{rb,erb,haml,slim,rhtml}"
end
end
Hence, the task looks in the gem root and, as before, *Rails.root* for
files to translate.
My question: Is there a way to find *.po* files in both places? I am OK
with *.mo* files being stored in Rails.root/locales. (The .mo files can
then be checked into the repo for the app without affecting the gem repo.)
But I would like a way for the *.po* files of the gem to override any *.po*
files in the app.
Any ideas?
Martin
--
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rails-i18n.
For more options, visit https://groups.google.com/d/optout.