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

(This post was last modified: 01-30-2020, 12:09 PM by jreklund.)

CodeIgniter dosen't support this. It never truncates fr-CH into fr. It will only look for absolute matches.

If you want this kind of behavior, you will need to copy the code from CodeIgniter\HTTP\Negotiate. language(), getBestMatch(), parseHeader, match(), matchParameters() and matchTypes().
And create a filter or event:
https://codeigniter4.github.io/userguide...lters.html
https://codeigniter4.github.io/userguide...vents.html

Or you can replace those methods (parseHeader) with "extending core classes". FYI it are used by media, charset, encoding and language. So you don't break any of those.
https://codeigniter4.github.io/userguide...asses.html

Or fork CodeIgniter 4, tweak the source code and make a Pull Request. Making this project even better!
Reply


Messages In This Thread
RE: Recognize child locale as parent locale - by jreklund - 01-30-2020, 12:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB