Operations inside Rails I18n locales' strings
- by Cristobal Viedma
Hi, I am trying to put operations inside the locales to adapt to different languages. For example, in English a billion is 1,000,000,000, however in Spanish a billion is 1,000,000,000,000 so I would like to be able to have the following:
en:
billion: "You have %{money} billions"
es:
billion: "Tienes %{money/1000.0} billones"
In order to be able to write:
I18n.t :billion, :money => whatever
And be right for whatever language.
However, it seems that I cannot put operations inside the locales' strings.
Any hint on how should I be doing this? Maybe my approach is just wrong "philosophically" talking?
Thanks all!