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

Support passing different locale to Intl APIs #949

Closed
ahmedriad1 opened this issue Mar 20, 2024 · 1 comment
Closed

Support passing different locale to Intl APIs #949

ahmedriad1 opened this issue Mar 20, 2024 · 1 comment
Labels
enhancement New feature or request unconfirmed Needs triage.

Comments

@ahmedriad1
Copy link

Is your feature request related to a problem? Please describe.

Currently, all formatting logic uses the locale inferred from the context. This causes a problem when formatting requires a more specific locale code. For an example, the ar locale (Arabic) does not localize numbers into Arabic, and you have to explicitly change the locale name to ar-SA, which is not the desired url code

Describe the solution you'd like

Add a new config option to both getRequestConfig and NextIntlClientProvider called formattingLocale that is used for formatting

Describe alternatives you've considered

Manually doing rewrites in the middleware from /ar to /ar-SA internally, but that requires changing a lot of code using <Link /> and useRouter

@ahmedriad1 ahmedriad1 added enhancement New feature or request unconfirmed Needs triage. labels Mar 20, 2024
@amannn
Copy link
Owner

amannn commented Mar 20, 2024

This is discussed in #653. I'm aiming for built-in support for this eventually, but you can learn about workarounds that can be used currently in the issue (including a community-maintained package that wraps relevant parts from next-intl).

@amannn amannn closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants