Server: Unit for temperature in dashboard weather widget is always Celsius

Created on 15 Oct 2020  路  3Comments  路  Source: nextcloud/server

Is your feature request related to a problem? Please describe.
The weather widget on the dashboard shows the temperature in Celsius, regardless of the locale. In the US, for example, I would expect it to show degrees Fahrenheit by default.

Describe the solution you'd like
Default to degrees Fahrenheit when the locale is en-US, or allow user to select their desired units.

0. Needs triage enhancement

Most helpful comment

Ah, that did the trick! Thank you.

All 3 comments

This is definitely a pretty obvious miss, doesn't make any sense for it to default to Celsius for US. Furthermore, I don't see an option to change this anywhere unless I'm blind.

EDIT: @mrstegeman I just managed to fix mine by changing my settings > Personal Info > Locale from English (United States) to just "English" and then for good measure English (Europe) and English (World) before changing it back to English (United States). When I went back to the dashboard things now show properly as Fahrenheit.

This is obviously just a workaround and the upgrade to 20 clearly isn't properly seeing this setting initially.

The issue seems to be that weather_status is looking for the user's locale in the oc_preferences table.

In your personal 'preferences' page, the locale shown by default is determined by NC based on your browser settings, and is probably correct.

Changing the locale preference to something else, then changing it back to the same value that was displayed when you started, creates an entry for your user account in oc_preferences. Once this entry exists, weather_status uses the appropriate temperature indicator for your locale.

All of the users on my server show "English (United States)" in the personal locale page, but the account I reset using the above process is the only one that displays the temperature in Fahrenheit, and is the only one with a 'locale' entry in oc_preferences.

# mysql nextcloud -e "select * from oc_preferences where configkey = 'locale';"
+---------+-------+-----------+-------------+
| userid  | appid | configkey | configvalue |
+---------+-------+-----------+-------------+
| mmccarn | core  | locale    | en_US       |
+---------+-------+-----------+-------------+

Ah, that did the trick! Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mama21mama picture mama21mama  路  3Comments

williambargent picture williambargent  路  3Comments

brylie picture brylie  路  3Comments

blackcrack picture blackcrack  路  3Comments

MorrisJobke picture MorrisJobke  路  3Comments