Skip to content

locale can be longer than just 2 letter code #86

Closed
@Crystal-RainSlide

Description

@Crystal-RainSlide

For this assertion:

assert len(locale_set) == 2, "locale must be a 2 letter code, see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes"

...and the way locale is used:


"date": format_date(loc_revision_date, format="long", locale=locale),

...and the document of Babel and timeago:

Instead of just 2 letter code, locale also support longer format like en_US, or even:

This assertion should be lifted, and document of this plugin may be changed accordingly, from ISO 639-1 to the document of Babel and timeago.


Change locale to locale: { default: en, babel: en_US, timeago: en_short } or:

locale: en
locale_babel: en_US
locale_timeago: en_short

... may also be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions