1

In config\application.rb I added this line of code:

config.i18n.default_locale = :de

And then I wrote something for test in a view like this, BUT it is still formatting the money in US dollars. Shouldn't it be formatting it by the locale I gave to it?

<p>woo! I have this much money: <%= number_to_currency(9800.56) %></p>
Bohn
  • 26,091
  • 61
  • 167
  • 254
  • Do you have a locale file at: `/config/locales/de.yml`? See http://stackoverflow.com/questions/7237592/number-to-currency-problem – PinnyM Jan 28 '13 at 15:25
  • no, Oh I was thinking the method will take care of it? So I still need the yml file? – Bohn Jan 28 '13 at 15:26
  • 2
    Yes, you can get it [here](https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/de.yml). If the locale file can't be found, rails assumes that it won't have the required info and reverts to using 'en'. – PinnyM Jan 28 '13 at 15:26
  • you can post it as answer too if you want. – Bohn Jan 28 '13 at 15:28

1 Answers1

1

You need to have a 'de' locale installed at /config/locales/de.yml for this to work, you can get it here. If the locale file can't be found, rails assumes that it won't have the required info and reverts to using 'en'. See similar problem at number_to_currency locale converting.

Community
  • 1
  • 1
PinnyM
  • 35,165
  • 3
  • 73
  • 81