Welcome Guest, Not a member yet? Register   Sign In
Recognize child locale as parent locale
#1

Hello everyone,

Most locales have children locales. For example, "en" has "en_UK", "en_US", "en_AU", "en_CA", and so on. (FYI, "en" has 105 children locales!)

My browser is configured to look for "fr-CH,en-US;q=0.7,en;q=0.3", which means it will look for Swiss French before anything else, then US English, then other English. This is the default settings for my browser.

My website default locale is "fr", and the supported locales are "fr" and "en", all set in Config\App.

I'd like the default language to be French, but CodeIgniter4 insists on serving me English, because "en" is in my browser "Accept-Language" list and "fr" isn't!
I know for a fact that this is the reason, for if I add "fr" to the list of "Accept-Language", before "en", the site switches to French.

How can I accept the children locales (i.e. "fr_CH") as their parents (i.e. "fr")?
Reply


Messages In This Thread
Recognize child locale as parent locale - by SteeveDroz - 01-29-2020, 10:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB