Skip to content

Don't lose region/territory when converting back from display name #53

Description

@CaptainDriftwood

Given a language code of en-ca, the following currently happens:

code = "en-ca"
tag = langcodes.get(code)  # Language.make(language='en', territory='CA')
display_name = tag.display_name()  # 'English (Canada)'
tag = langcodes.find(display_name)  # <- .find does not capture the territory, yielding Language.make(language='en')

Is there any way .find could correctly get the territory from the display name?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions