Recognize child locale as parent locale |
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! |
Messages In This Thread |
Recognize child locale as parent locale - by SteeveDroz - 01-29-2020, 10:56 PM
RE: Recognize child locale as parent locale - by InsiteFX - 01-30-2020, 05:43 AM
RE: Recognize child locale as parent locale - by SteeveDroz - 01-30-2020, 09:14 AM
RE: Recognize child locale as parent locale - by jreklund - 01-30-2020, 12:07 PM
RE: Recognize child locale as parent locale - by SteeveDroz - 01-30-2020, 11:03 PM
RE: Recognize child locale as parent locale - by jreklund - 01-31-2020, 12:36 PM
|