Skip to content

Locale vs Language #101

Answered by sergiodxa
xavipolo asked this question in Q&A
Nov 3, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The getLocale method will give you the user locale that the user wants from your supported list of languages.

So if the user prefers Spanish over English, and you support both the getLocale function will give you es.

If you want the whole list of detected locales you'll have to copy this https://github.com/sergiodxa/remix-i18next/blob/main/src/lib/get-client-locales.ts which is what the language detector class uses internally to get the user locales from the Accept-Language header

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xavipolo
Comment options

Answer selected by xavipolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants