Req #54178 [Opn]: make a better intl Locale::acceptFromHttp
| From: | cmb@php.net | Date: | Wed, 01 Sep 2021 12:47:14 +0000 |
| Subject: | Req #54178 [Opn]: make a better intl Locale::acceptFromHttp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236212@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54178&edit=1
ID: 54178
Updated by: cmb@php.net
Reported by: giorgio dot liscio at email dot it
Summary: make a better intl Locale::acceptFromHttp
Status: Open
Type: Feature/Change Request
Package: I18N and L10N related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
There is nothing wrong with uloc_acceptLanguageFromHTTP() per se;
it's rather that Locale::acceptFromHTTP() should have an optional
parameter which allows to pass in the locales supported by the
caller. This could be passed to the ICU function as
availableLocales.
PRs welcome!
Previous Comments:
------------------------------------------------------------------------
[2013-04-12 12:47:41] millenium dot maestro at gmx dot de
I agree!
What kind of black magic does php use to detect the best supported language of
my application?
eg: Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
and now the application supports the locales "it-IT" and "en", but the result of
Locale::acceptFromHttp is "de-DE".
I'm pretty sure nobody will use a implementation with such useless results.
weird enough the icu lib is supporting this behavior! see @ http://icu-
project.org/apiref/icu4c/uloc_8h.html#aced06018568333e1906ae104ab62757a
------------------------------------------------------------------------
[2011-03-07 09:14:49] giorgio dot liscio at email dot it
Description:
------------
hi, would be nice to have some like this in the lib
http://www.thefutureoftheweb.com/blog/use-accept-language-header
the current implementation of Locale::acceptFromHttp is not useful at all
thank you
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54178&edit=1