Add class BrowserHeaders to parse Accept-Language and Accept-Encoding headers.
The return for these should be always an array of values ordered in the order they appear in headers
The value of "q=" should be used according the W3C standards.
When there is no q then just use the order of appearance, otherwise use value of "q"
Then we can use these values to set the Translation's object locale to the first match of supported language
For Charset we always serve pages in UTF-8 format but if utf-8 is not in the list of accepted charsets then we can recode into the user's prefered charset using iconv() from the output buffer but only if iconv extension is available.
For this to work we should not hard-code the utf-8 into headers like we do now in index.php
Add class BrowserHeaders to parse Accept-Language and Accept-Encoding headers. The return for these should be always an array of values ordered in the order they appear in headers The value of "q=" should be used according the W3C standards. When there is no q then just use the order of appearance, otherwise use value of "q"
Then we can use these values to set the Translation's object locale to the first match of supported language
For Charset we always serve pages in UTF-8 format but if utf-8 is not in the list of accepted charsets then we can recode into the user's prefered charset using iconv() from the output buffer but only if iconv extension is available.
For this to work we should not hard-code the utf-8 into headers like we do now in index.php