Forum: Rails I18n It just won't load

Posted by Tony Maserati (abletony84)
on 2010-06-07 22:18
(Received via mailing list)
Hey,

im trying desperately to load my norwegian translation file here..

I've set config.i18n.default_locale = :nb_NO which should load config/
locales/nb_NO.yml yeah? it just loads config/locales/en_US.yml. both
locales are present in config/ and i can't see anything wrong with the
nb_NO.yml syntax..

Thanks!
Posted by Edouard (Guest)
on 2010-06-07 22:36
(Received via mailing list)
Hey,

Check in your `config/environments.rb` if you have something like:

config.i18n.load_path << Dir[File.join(Rails.root, 'config',
'locales', '*.{rb,yml}')]

Then rails should load all YAML files in `config/locales/*`.
Alternatively, do you have `nb_NO:` at the root of your norwegian YAML
file?

Regards,
Édouard
Posted by Jürgen Feßlmeier (Guest)
on 2010-06-07 22:40
(Received via mailing list)
Try I18n.locale = :":nb-NO"

Kind regards,
Juergen
Posted by Iain Hecker (Guest)
on 2010-06-08 02:14
(Received via mailing list)
By default Rails loads every .rb and .yml file in config/locales, so
you shouldn't be setting the load path yourself. And you should use a
dash instead of an underscore. Neither of these are solutions to your
problem, but just check it to see if it's accurate.

Iain

On Mon, Jun 7, 2010 at 16:33, Jürgen Feßlmeier
Posted by Tony Maserati (abletony84)
on 2010-06-08 12:11
(Received via mailing list)
Thank y'all so much for the response fellas - my yml had nb_NO: at the 
root
but needed "nb-NO": - and my environment.rb had 
config.i18n.default_locale =
:nb_NO but needed config.i18n.default_locale = :"nb-NO". Hopefully I can 
buy
y'all a beer sometime.

Have a great day!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.