Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide language tag / BCP 47 for each locale #1360

Closed
Shinigami92 opened this issue Sep 9, 2022 · 1 comment
Closed

Provide language tag / BCP 47 for each locale #1360

Shinigami92 opened this issue Sep 9, 2022 · 1 comment
Assignees
Labels
c: feature Request for new feature c: locale Permutes locale definitions

Comments

@Shinigami92
Copy link
Member

Clear and concise description of the problem

Currently we have the name of a locale only available at compile time or need to access them e.g. via Object.keys(faker.locales)
But some feature requests like #350 need the BCP 47 language tag

But not only for this, but also for other features in the future it could be useful to access the language tag at runtime inside faker, or e.g. fetch it from the current used locale when we do not have locale as in v7 anymore

Suggested solution

Add a new key like title and separator into the locale definitions (at root level for a LocaleDefinition)

Alternative

Not sure if we might want to add several tags/keys because there is a locale and a country part.
Also not sure if there are other important formats we need to benefit from. (At least BCP 47 is the one that is mentioned in the JS mozilla docs)

Additional context

@Shinigami92 Shinigami92 added the s: pending triage Pending Triage label Sep 9, 2022
@import-brain import-brain added c: feature Request for new feature and removed s: pending triage Pending Triage labels Sep 9, 2022
@xDivisionByZerox
Copy link
Member

This has been implemented in #2025 by providing a language property to a locale's MetadataDefinition object.

@xDivisionByZerox xDivisionByZerox added the c: locale Permutes locale definitions label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature c: locale Permutes locale definitions
Projects
None yet
Development

No branches or pull requests

4 participants