Default temperature unit to Fahrenheit for US locales (fixes #11)#12
Open
sholsinger wants to merge 1 commit into
Open
Default temperature unit to Fahrenheit for US locales (fixes #11)#12sholsinger wants to merge 1 commit into
sholsinger wants to merge 1 commit into
Conversation
The temperature unit setting previously defaulted to Celsius for all users, even those whose phone locale is en-US or es-US. Since the user has to open the config page to change it, US users see Celsius on first run and never learn the setting exists. Seed SETTING_TEMP_UNIT from navigator.language in two places: - config-page/src/utils/defaultSettings.ts — so the settings UI shows the correct default selection. - src/pkjs/index.js — so weather displays in the right unit even before the user has opened the config page. Kept narrow (US only) since the setting flips the whole imperial bundle (temp + wind + rain), and Fahrenheit-preferring locales outside the US are rare enough that a misdefault is worse than the current behavior. Fixes freakified#11
Author
|
I admit, after having Claude help out with this, I realized this isn't really necessary. I think what happened was that after switching to another watchface, all my settings were lost and I couldn't find the unit setting again. 🤦🏼♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SETTING_TEMP_UNITdefaults to Celsius for everyone. US users see Celsius on first install and, unless they discover the setting hidden in the config page, they never get Fahrenheit.navigator.languageso users onen-US/es-USget Fahrenheit + MPH + inches out of the box. Everyone else is unchanged.Changes
config-page/src/utils/defaultSettings.ts— locale-aware default so the settings UI shows the correct pre-selection.src/pkjs/index.js— locale-aware fallback insendDataToWatch()for the case where the user hasn't opened the config page yet (settings.SETTING_TEMP_UNIT === undefined). Any explicitly saved value still wins.Kept the locale list narrow (US only) because this setting bundles temp + wind + rain, so a misdefault degrades three fields at once. Happy to broaden it (Bahamas, Belize, Cayman, Liberia, etc.) if you'd prefer.
Test plan
en-US: verify temp shows in °F and wind in MPH before opening config.en-GB/de-DE/ etc.: verify temp shows in °C and wind in KM/H (no regression).Fixes #11