-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(dashboard): Make sure fallback locale en also recognized by weather_status for F vs C usage
#49986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes #23486 Signed-off-by: Josh <josh.t.richards@gmail.com>
en also uses Fen also recognized by weather_status to F vs C usage
en also recognized by weather_status to F vs C usageen also recognized by weather_status for F vs C usage
|
/compile / |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
The more I think about this, this is not the correct approach and something else is going on here. Results in our template returning: And we appear to pick the right locale on the Personal settings page, which is why the problem goes away when selected and saved. Think I need to wait for my coffee to kick in... |
|
As I suspected the problem is broader. We're not showing the actual (active) TLDRThe inconsistency is we call Assuming we're comfortable with how locale handling is working in general, the fix just needs to happen in the Personal settings page. DetailsFor the same user (when they have not yet saved a locale in their preferences):
Cause: In our template we call it as server/lib/private/L10N/Factory.php Lines 115 to 116 in d8d708e
...which means if a user doesn't have a locale saved yet we hit this fallback code: server/lib/private/L10N/Factory.php Lines 267 to 269 in d8d708e
This returns the language ( But when the user loads up their Personal settings we populate the active locale without providing the language clue to
...So we hit a different fallback: server/lib/private/L10N/Factory.php Lines 272 to 274 in d8d708e
And thus return a different initial locale for the same user. This finally explains why the Personal settings page always shows me the right thing, but behavior elsewhere in Nextcloud doesn't match it. FixingSo I think we have two paths to consider here:
|
|
Superseded by #49988 |
BROADER ISSUE DISCOVERED. On-hold until #49988 is reviewed
Summary
This should fix #23486. We use
enas the fallback locale in numerous places. Since the underlying cause for this bug only occurs when the fallback is being relied upon seems to makes sense to include it here. Alternative would be to change the fallback locale to something likeen_USacross our code base, but that seems both overly drastic and unnecessary.Refs: #23486 (comment)
TODO
Checklist