Allow users to choose between Celsius and Fahrenheit.#314
Open
Kyome22 wants to merge 4 commits into
Open
Conversation
Introduce TemperatureUnit (System/Celsius/Fahrenheit) with extension methods for string conversion, localization, and resolution against the OS region default. Add Menu_TemperatureUnit and TemperatureUnit_* keys to all seven language resources. Nothing references the enum yet; the build remains green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the static usesFahrenheit cache with an explicit TemperatureUnit parameter on GetDescription / GenerateIndicator. The resolution logic (System -> region default) now lives on TemperatureUnitExtension so the repository no longer carries process-wide state. Program.cs passes TemperatureUnit.System for now, preserving the existing behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Persist the chosen unit in UserSettings (empty default falls back to TemperatureUnit.System), wire it through Program.cs, and add a "Temperature Unit" submenu next to Theme. With System the indicator keeps following the OS region default; Celsius/Fahrenheit override it explicitly. Updates appear on the next fetch tick. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fa3391d to
27ad707
Compare
There was a problem hiding this comment.
Pull request overview
Adds a user-configurable temperature unit setting (Celsius/Fahrenheit/System) and threads that choice through the tray UI and temperature formatting so users can override the default unit selection.
Changes:
- Introduce
TemperatureUnitenum + localization helpers and “System” (auto) resolution. - Pass the selected unit into temperature tooltip/indicator rendering and persist it in user settings.
- Add a new context menu setting to select the temperature unit, plus localized strings across supported languages.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| RunCat365/TemperatureUnit.cs | Defines temperature unit options and localization/system-default resolution logic. |
| RunCat365/TemperatureRepository.cs | Updates temperature text formatting to accept a resolved unit instead of implicitly choosing Fahrenheit. |
| RunCat365/Properties/UserSettings.settings | Adds persisted TemperatureUnit user setting. |
| RunCat365/Properties/UserSettings.Designer.cs | Exposes TemperatureUnit setting accessor. |
| RunCat365/Properties/Strings.resx | Adds new menu/unit localization keys (default language). |
| RunCat365/Properties/Strings.de.resx | Adds German localization for new temperature unit strings. |
| RunCat365/Properties/Strings.es.resx | Adds Spanish localization for new temperature unit strings. |
| RunCat365/Properties/Strings.fr.resx | Adds French localization for new temperature unit strings. |
| RunCat365/Properties/Strings.ja.resx | Adds Japanese localization for new temperature unit strings. |
| RunCat365/Properties/Strings.zh-CN.resx | Adds Simplified Chinese localization for new temperature unit strings. |
| RunCat365/Properties/Strings.zh-TW.resx | Adds Traditional Chinese localization for new temperature unit strings. |
| RunCat365/Properties/Strings.Designer.cs | Adds strongly-typed accessors for the new localized strings. |
| RunCat365/Program.cs | Loads/saves selected temperature unit and uses it when rendering temperature info. |
| RunCat365/ContextMenuManager.cs | Adds “Temperature Unit” submenu to settings and wires selection to persistence. |
Files not reviewed (2)
- RunCat365/Properties/Strings.Designer.cs: Language not supported
- RunCat365/Properties/UserSettings.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ThemeExtension.GetString was last used by SetIcons before localization and icon-name refactors moved every caller off it. The TemperatureUnit version was copied from the Theme template and never had a caller. Remove both so the extensions only carry the methods that are actually used (GetLocalizedString, Resolve, GetContrastColor). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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.
Context of Contribution
Summary of the Proposal
By default, Celsius or Fahrenheit is automatically selected based on the language.
Users can manually specify Celsius or Fahrenheit in the user settings.
Reason for the new feature
#310
Checklist