Closed schlos closed 3 years ago
It still loads site with a Croatian as default language: http://cfc-staging-v3.poplar.phl.io/
Auto-language selection works with
Accept-Language header:
hr_HR,hr
-> site language is HRnull
-> site language falls back to default (EN) --> Fail, expected is to fall back to HRMod headers with ModHeader: https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj/
I would probably make new PR upstream to change https://github.com/codeforcroatia/codeforcroatia.org/blob/emergence/vfs-site/master/php-classes/Emergence/Locale.php so that we have initial setting with primary language and if it's set, then page will always initially load in predefined primary language.
There is bug because it will fall back always to en_US rather than configured language in php-config: https://github.com/codeforcroatia/codeforcroatia.org/blob/master/php-config/Emergence/Locale.config.php It seems this configuration is not overriding default set value in Locale.php.
i.e. Accept-Language header is set to de_DE,de
--> site will be displayed in en_US
New primary language feature will be tracked via separate issue https://github.com/codeforcroatia/codeforcroatia.org/issues/53
Check what is my Request headers (Accept-Language): https://manytools.org/http-html-text/http-request-headers/
Before test:
Device 1: Request headers
Device 2: Request headers
Device 3: Request headers
Info from Chris regarding setting default language in https://github.com/codeforcroatia/codeforcroatia.org/blob/emergence/vfs-site/master/php-classes/Emergence/Locale.php#L11:
changing those values is what the php-config tree is for
create a file under a path matching the class name in there and you can change any of the classes static public properties as part of when it gets loaded