What is Nostr?
Andrea Grandi 🦕 /
npub1sae…9nj8
2023-11-07 08:49:34

Andrea Grandi 🦕 on Nostr: What happens in a #Django app if user has language set to 'pt-PT' but only 'pt-BR' is ...

What happens in a #Django app if user has language set to 'pt-PT' but only 'pt-BR' is available?

In an app I have, we see it defaulting to 'pt-BR' instead of defaulting to 'en'.

The docs only mention what happens when for example 'pt' is available but not what happens when only another variant is available https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#how-django-discovers-language-preference

I'm ending up implementing my own CustomLocaleMiddleware, but I'm wondering if I'm missing some easier setting.

#Python #development #webdev
Author Public Key
npub1sae75t3r3hcg2qqsrehx7aerq59ejfj08hq02yjvjs4e4vgn52vqgp9nj8