php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54178 make a better intl Locale::acceptFromHttp
Submitted: 2011-03-07 09:14 UTC Modified: 2021-09-01 12:47 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: giorgio dot liscio at email dot it Assigned:
Status: Open Package: I18N and L10N related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2011-03-07 09:14 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-12 12:47 UTC] 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
 [2021-09-01 12:47 UTC] cmb@php.net
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!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 16:01:28 2024 UTC