Locale detection mismatch #438
-
Version5.12.0 Describe the bugI may be wrong and I think that may be more related to the browsers I also believe that in English it may works correctly as long English is an official language in the specific country. Anyway, I decided to share my feelings. My app has 4 locations: en, en-GB, pl, pl-PL I'm physically in the GB, and my browser has settings to prefer the Polish Language, but I getting content in Polish for Poland For my use case, I will need to turn off language detections in typesafe-i18n and go for IP-detection-based redirections, but I think that behaviour should be changed anyway. Reproductiontypesafe-i18n-demo-sveltekit + language with specific country code (depends on Browsers settings) LogsNo response ConfigNo response Additional informationSystem: macOS 12.5.1 (Language: PL, location: GB) SvelteKit: 1.0.0-next.476 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @oskar-gmerek, If you want to use the IP-address as a detection strategy, you would need to write your own custom locaale detector. You can find more information in the official docs |
Beta Was this translation helpful? Give feedback.
Hi @oskar-gmerek,
the example works as expected. The code in the example just uses the language-header for detection.
https://github.com/ivanhofer/typesafe-i18n-demo-sveltekit/blob/main/src/hooks.ts#L25-L28
If you want to use the IP-address as a detection strategy, you would need to write your own custom locaale detector. You can find more information in the official docs