Skip to content

Allow users to choose between Celsius and Fahrenheit.#314

Open
Kyome22 wants to merge 4 commits into
mainfrom
feature/temperature-unit-setting
Open

Allow users to choose between Celsius and Fahrenheit.#314
Kyome22 wants to merge 4 commits into
mainfrom
feature/temperature-unit-setting

Conversation

@Kyome22
Copy link
Copy Markdown
Collaborator

@Kyome22 Kyome22 commented Jun 2, 2026

Context of Contribution

  • Bug Fix
  • Refactoring
  • New Feature
  • Others

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

  • I have read the CONTRIBUTING.md and agree to follow it.
  • This PR does not contain commits of multiple contexts.
  • Code follows proper indentation and naming conventions.
  • Implemented using only APIs that can be submitted to the Microsoft Store.
  • Works correctly in both dark theme and light theme.
  • Works correctly on any device.

Kyome22 and others added 3 commits June 2, 2026 14:32
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>
@Kyome22 Kyome22 marked this pull request as draft June 2, 2026 06:55
@Kyome22 Kyome22 force-pushed the feature/temperature-unit-setting branch from fa3391d to 27ad707 Compare June 2, 2026 06:56
@Kyome22 Kyome22 marked this pull request as ready for review June 2, 2026 07:14
@Kyome22 Kyome22 requested a review from Copilot June 2, 2026 07:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TemperatureUnit enum + 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.

Comment thread RunCat365/TemperatureUnit.cs Outdated
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>
@Kyome22 Kyome22 requested a review from mor39a June 2, 2026 07:43
@mor39a mor39a linked an issue Jun 2, 2026 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Idea]: Add option to use Celsius instead of Fahrenheit

2 participants