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!
Based on investigation, here’s the solution. Sorry for the multiple edits.
So you could change your translation file to use :vals in :en and :money in :es.