You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Locale::acceptFromHttp accept a list of possible languages (or return all matches, at least) #24074
However, that just returns the top-most accepted language aka it does not allow one to pass in the languages that your application actually supports/is localized in, which makes it effectively useless, because you still need to implement fallback logic.
Why a acceptFromHttp if it is useless? The best matching is not useful at all. A list of matching locales is at least useful
proposed solution
Make it (optionally?) accept a second parameter with a sorted array of strings as supported languages (as by it's preference), which it cleverly parsed, properly-optimized and calculates the "best match" of:
Activity
Implement GH-24074: Locale::acceptFromHttp() available locales list
rugk commentedon Nov 9, 2026
@devnexen Oh thanks a lot, that was quick! Is this issue supposed to stay open even when you apparently already committed it into the main branch?
devnexen commentedon Nov 9, 2026
nope I forgot about this :) closing.