Internationalization
The Mojo framework includes Mojo.Format
, a set of
locale-aware methods to assist you with formatting different types of text
strings. The available methods are summarized in Table 11-2.
Table 11-2. Mojo.Locale and Mojo.Format methods
Method | Description |
---|---|
| Returns the currently set locale as an ISO 639-formatted string (e.g., en_us for US English) |
| Returns the currently set region as an ISO 639-formatted string (e.g., us for US English) |
| Formats the date object appropriately for the current locale |
| Formats the date object as
with |
| Converts a number to a string using the proper locale-based format for numbers and number separators |
| Converts a number representing an amount of currency to a string using the proper locale-based format for currency; does not do any currency rate conversion, just formatting |
| Formats a choice list to handle things like replacement parameters with plurals |
| Converts a number to a percent string using the proper locale-based format for percentages |
| Returns true if the current locale uses 12-hour time or false if 24-hour time |
| Returns current timezone |
The behavior of some ...
Get Palm webOS 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.