Rails 3.1.3
I would like to apply i18n for my application.
Since there are many yml files in config/locales directory, I have made
subdirectories so that the maintenance will be easier. For example,
config/locales/devise/
date/
top/
...
Each subdirectories contain corresponding locale files that are applied
when users change the language setting.
My question is:
How can I set the load_path for locales ?
in 'application.rb'
config.i18n.load_path += Dir[Rails.root.join('config', 'locales',
'**', '*.{rb,yml}')]
seems to work if the language setting is NOT dynamical. But I need to
set
initializers/i18n.rb in order to change the languages dynamically.
I18n.default_locale = 'en'
LOCALES_DIRECTORY = ######HERE????
LANGUAGES = {
'English' => 'en',
'Français' => 'fr',
'日本語' => 'ja',
'Deutsch' => 'de',
'Español' => 'es',
'한국어' => 'ko',
'Русский' => 'ru'
}
so hopefully, application_controller.rb can call the directories.
How should I set "LOCALES_DIRECTORY" ?
soichi
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.