#35 Fedora budget - numbers
Closed: Won't fix / Can't fix 7 years ago Opened 7 years ago by jibecfed.

Hi, I would like to use this mechanism (https://babel.edgewall.org/wiki/Documentation/0.9/numbers.html) to display numbers in a nice way in http://budget.fedoraproject.org/ when language is not English.

I read the documentation, but I haven't found the general explanation about the tools used to build website.
My I have a hint about how to this with templates ? I'll be please to try to make a pull request accordingly.

I think you are using genshi : https://genshi.edgewall.org/wiki/Documentation/0.6.x/i18n.html
in combination with babel https://babel.edgewall.org/
So I feel like it is not too complicated, but I do not know where to start.

Thanks for your help!


ok after further research, I understand I have to add this on top of the template :

<?python
  from babel.numbers import format_currency
?>

then for each numbers to add :

${format_currency(195000, 'USD')}

but on my computer, it always use my french locale, whatever locale I'm using for tests (I did pull translation and used make fr test) .

how can I get the current rendering locale and send it to the function like written in doc ? http://babel.pocoo.org/en/latest/api/numbers.html?highlight=format_currency#babel.numbers.format_currency

I wonder if this is one @decause could lend some wisdom on as the original site author.

The Fedora Budget page is now run by a different site, and will soon lo longer be part of the fedora-websites repo.

If this is still an RFE that you would like to see, would you be able to file this one over at it's new home?

https://pagure.io/fedora-budget-site

cheers!

Metadata Update from @ryanlerch:
- Issue close_status updated to: Won't fix / Can't fix
- Issue status updated to: Closed (was: Open)

7 years ago

The correct site for issues is https://pagure.io/fedora-budget the -site repo exists solely to hand off the site to infra

Login to comment on this ticket.

Metadata