Question

I use the Rails I18n feature. My locales are namespaces with for example: en-ZA.

When I run my model specs, it picks up the activerecord locales. When I run my controller specs, it picks up on my activerecord locales. When I run my acceptance (full stack) tests - it too picks up on the activerecord locales - except for one test.

When I run the entire suite at once - all those passing tests are now failing that it can't find my activerecord locales - the namespace it is complaining about though is all in lowercase.

When I change the namespace in the locale yml file to en-za - the tests pass - but others are failing that are now looking for the en-ZA locales (note the uppercase bit).

How can it be that when I run the entire suite it changes around whether it is looking for the lowercase or proper cased namespaces?

Also - when I run the acceptance tests only - there's just one failing test where it tries to access the activerecord locales with the wrong casing ...

It's very weird - and I don't know where to change this or set it that it should always use en-ZA (and not en-za).

My default locale is set up to en-ZA.

Was it helpful?

Solution 2

I couldn't figure out the source of the bug - but have found an easy solution:

Use only lowercase letters for all my locales.

OTHER TIPS

Try to look at your config/initializers/i18n.rb - may be some available_locales are uppercased there?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top