Forum: Rails I18n localization in a structured hierarchy of .yml files

Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2010-09-23 20:06
(Received via mailing list)
[Rails 3, Ruby 1.9.2]
I tried to split my localizations into a structured hierarchy of
files :

default
   en.yml
   fr.yml
   de.yml
models
   users
     en.yml
     fr.yml
     de.yml
views
    users
     en.yml
     fr.yml
     de.yml

but this doesn't get loaded ?
I tried  config.i18n.load_path += Dir[Rails.root.join('config',
'locales', '*.{rb,yml}').to_s]

but this doesn' help ...
how can I get all these loaded ?

thanks for your suggestions
390e714e320bd505fb5e9f762870ba5e?d=identicon&s=25 Krzysztof Knapik (Guest)
on 2010-09-23 20:23
(Received via mailing list)
2010/9/23 Erwin <yves_dufour@mac.com>:
>     en.yml
> 'locales', '*.{rb,yml}').to_s]
config.i18n.load_path +=
Dir[Rails.root.join('config/locales/**/*.{rb,yml}').to_s] ?
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2010-09-23 23:04
(Received via mailing list)
Thanks Krzysztof,

That's what I tested .. but it gives me an ArgumentError
------------  console --------------
$ rails c
Loading development environment (Rails 3.0.0)
ruby-1.9.2-p0 > I18n.t(:buddy)
ArgumentError: syntax error on line 43, col 3: `   common:'
  from /Users/yves/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:
135:in `load'

:buddy is in   config/locales/defaults/en.yml  and config/locales/
defaults/fr.yl

is there any way to check what's loaded and how ?

Erwin
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2010-09-23 23:20
(Received via mailing list)
The config.i18n.load_path is correct ..
I listed this array all files are there ...
there is an error in one of the files given with the Devise gem...

thanks a lot
This topic is locked and can not be replied to.