Why don't my locale settings in number_to_currency work?


Remove custom language ymls and add the correct version of the i18n-rails gem. This resolved this special issue.

Original answer:

Ok my guess is that your en-GB.yml is empty. So it actually finds the file and adds the locale in I18n.available_locales BUT this does not include that all translations are available.

When you look at the format of such a yml file you will recognize they all start with

  some_keys: ...

This is what actually is loaded into memory and therefore provides all the available translations. Available locale is just defined by found files in config/locales.

When you check the source of number_to_currency It takes the locale from the options and passes it along the key it looks for to I18n.

I18n.translate(:'number.format', :locale => options[:locale], :default => {})

Since you just say that en-GB is available but don't have the actual keys along the locale in memory you get the missing translation issue.

What I suggest is you either use the content of the linked yml file and paste it into your en-GB.yml or you remove your en-GB.yml and find a 3.2 working i18n-rails version and use it. i18n-rails provides plenty of default translations which are utilized all over default rails.

Addition: Before you added the en-GB.yml file it actually worked like expected. When no locale is found it defaults to dollar in here since the currency variable will be just and empty {}.