-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
https://www.npmjs.com/package/next-export-i18n#usebrowserdefault notes "Remember that next-export-i18n considers only the primary subtag, e.g., en-US from the will be read as en.
But this doesn't have to be the behavior, right? It would be nice for one website to support both Traditional and Simplified Chinese using this package, even though they both start with zh (zh-cn and zh-tw).
My idea is adjusting this function to get the language without the split if such translations exist, or otherwise use the split if those translations exist:
next-export-i18n/module/src/index.tsx
Lines 25 to 30 in a8dc8b3
| browserLang = ( | |
| (window.navigator.languages && window.navigator.languages[0]) || | |
| window.navigator.language | |
| ) | |
| .split("-")[0] | |
| .toLowerCase(); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels