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
I am not entirely sure what is the expected behaviour here, but I got really confused when I saw it, so raising the query.
When using i18n_embed::DesktopLanguageRequester, I noticed that even if I set en-GB to be the fallback locale for a piece of software, if a user has en in the desktop but not en-GB then en-US will be the fallback, where it exists. This is not desirable in my case as en-US may be a partial translation, so will be inconsistently jumping between en-GB and en-US for users who do not set either. The only way to make en-GB override en-US is either to have the user explicitly add en-GB as their desktop locale or to remove en-US as an available translation.
This is because the sequence:
requested = ["en-IE", "en", "en-GB"] # first two from desktop, third is fallback
available = ["en-GB", "en-US"]
will get to en and then en-US will match en (as en-Latn-US) just before en matches en-GB. This seems fine, except that en-GB is in the requested list, and en-US is not. This means:
To better understand what I was expecting, I tried to code a rough patch to demonstrate the difference - in this case, it ranks any exact matches up-front, so that if a requested locale matches multiple available locales as a range/variant, then it prioritizes any that are actually requested exactly. I am not sure if that is better, but keen to understand if this is intended, or if there is a reason that the actual_supported is preferable.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I am not entirely sure what is the expected behaviour here, but I got really confused when I saw it, so raising the query.
When using
i18n_embed::DesktopLanguageRequester
, I noticed that even if I seten-GB
to be the fallback locale for a piece of software, if a user hasen
in the desktop but noten-GB
thenen-US
will be the fallback, where it exists. This is not desirable in my case asen-US
may be a partial translation, so will be inconsistently jumping betweenen-GB
anden-US
for users who do not set either. The only way to makeen-GB
overrideen-US
is either to have the user explicitly adden-GB
as their desktop locale or to removeen-US
as an available translation.This is because the sequence:
will get to
en
and thenen-US
will matchen
(asen-Latn-US
) just beforeen
matchesen-GB
. This seems fine, except thaten-GB
is in the requested list, anden-US
is not. This means:To better understand what I was expecting, I tried to code a rough patch to demonstrate the difference - in this case, it ranks any exact matches up-front, so that if a requested locale matches multiple available locales as a range/variant, then it prioritizes any that are actually requested exactly. I am not sure if that is better, but keen to understand if this is intended, or if there is a reason that the
actual_supported
is preferable.The text was updated successfully, but these errors were encountered: