Chapter 20.3.4. Locale-Specific Objects

To localize an application completely, simply translating user interface messages often is not enough.

Different locales often use different representations for things like dates, numbers, currencies, and so forth. All locale-specific data resides in the turbogears.i18n.format module.

These functions also take an optional locale argument; if it is None, the current user locale is used.

These low-level functions might be of help if you are building your own locale libraries.

Higher-level functions solve more complete tasks:

  • format_number— Formats a number using a locale-specific group separator symbol

  • format_decimal— Like format_number, handles locale-specific separators, but also handles decimals with ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.