
Public Member Functions | |
| def | __init__ |
| def | format_date |
| def | format_day |
| def | friendly_number |
| def | get |
| def | get_closest |
| def | list |
| def | translate |
Public Attributes | |
| code | |
| name | |
| rtl | |
| translations | |
Private Attributes | |
| _months | |
| _weekdays | |
Object representing a locale. After calling one of `load_translations` or `load_gettext_translations`, call `get` or `get_closest` to get a Locale object.
| def tornado.locale.Locale.__init__ | ( | self, | |
| code, | |||
| translations | |||
| ) |
Reimplemented in tornado.locale.GettextLocale.
| def tornado.locale.Locale.format_date | ( | self, | |
| date, | |||
gmt_offset = 0, |
|||
relative = True, |
|||
shorter = False, |
|||
full_format = False |
|||
| ) |
Formats the given date (which should be GMT).
By default, we return a relative time (e.g., "2 minutes ago"). You
can return an absolute date string with ``relative=False``.
You can force a full format date ("July 10, 1980") with
``full_format=True``.
This method is primarily intended for dates in the past.
For dates in the future, we fall back to full format.
| def tornado.locale.Locale.format_day | ( | self, | |
| date, | |||
gmt_offset = 0, |
|||
dow = True |
|||
| ) |
| def tornado.locale.Locale.friendly_number | ( | self, | |
| value | |||
| ) |
| def tornado.locale.Locale.get | ( | cls, | |
| code | |||
| ) |
| def tornado.locale.Locale.get_closest | ( | cls, | |
| locale_codes | |||
| ) |
| def tornado.locale.Locale.list | ( | self, | |
| parts | |||
| ) |
| def tornado.locale.Locale.translate | ( | self, | |
| message, | |||
plural_message = None, |
|||
count = None |
|||
| ) |
Returns the translation for the given message for this locale. If ``plural_message`` is given, you must also provide ``count``. We return ``plural_message`` when ``count != 1``, and we return the singular form for the given message when ``count == 1``.
Reimplemented in tornado.locale.GettextLocale, and tornado.locale.CSVLocale.
tornado::locale.Locale::_months [private] |
tornado::locale.Locale::_weekdays [private] |