Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:27:53+00:00 2026-05-28T18:27:53+00:00

locale_accept_from_http is a basic wrapper around ICU’s API uloc_acceptLanguageFromHTTP but the PHP/PECL implementation seems

  • 0

locale_accept_from_http is a basic wrapper around ICU’s API uloc_acceptLanguageFromHTTP but the PHP/PECL implementation seems fundamentally flawed that it uses the systems entire set of locales instead of taking a list as a parameter?

For example say a user has HTTP_ACCEPT_LANGUAGE = zh-HK;q=0.2, fr, i.e. the user reads Traditional Chinese or French, preferring the latter. You have, for example, a news site that offers articles in say Traditional Chinese and Simplified Chinese. Using the API
Locale::acceptFromHttp
will only return fr.

<?php
var_dump (Locale::acceptFromHttp ("zh-HK;q=0.2,fr"));
?>

Outputs:

string(2) "fr"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:27:54+00:00Added an answer on May 28, 2026 at 6:27 pm

    Correct, PHP wraps ICU’s uloc_acceptLanguageFromHTTP without the ability to pass your locale list. Overall, intl extension is relatively new (PHP 5.3+) and I did find a couple of bugs myself which were quickly fixed within the next release.

    What you could do is:

    • Submit a bug/feature request. There is a similar bug already reported.

    • Accept-Language format is really not that complex, I bet you could write your own parser within 20 lines of code. See this article for an example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that SQL Server does not accept numbers formatted using any particular locale.
I can output a locale sensitive time format using strftime('%X') , but this always
I've followed all the steps in multiple tutorials to enable mod_deflate in Apache but
We've having trouble deploying a web service that works in our development environment, but
I am trying to configure some basic HTTP authentication over HTTPS using the spring
I have a WCF web service that works perfectly with an http address, but
I have finalized a small PHP application that can serve many documents. These documents
I have problem with connecting to Sql Server from my local machine. Seems like
I'm trying to implement internationalization on my project, but the pages only get translated
I can enter via web http://localhost:8080/tfs/web with any user, from remote or local, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.