Skip to content

Revamp: resource-based localization, bug fixes, naming cleanup, .NET 10 - #2

Merged
SebastianOehm merged 19 commits into
mainfrom
revamp
Oct 3, 2026
Merged

SebastianOehm merged 19 commits into
mainfrom
revamp

Conversation

@SebastianOehm

@SebastianOehm SebastianOehm commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replaces the JSON language-file system with standard .NET resources (English and German), fixes several bugs found along the way, cleans up naming and analyzer violations, and moves the project from net6.0 to net10.0.

Changes

Localization

  • UI strings now come from Properties/Resources.resx and Resources.de.resx. LanguageLoader maps the chosen language to a culture and an OpenWeatherMap language code.
  • Removed TranslationMaker, the langVal model and the langFiles download in superuser mode. Only English and German are offered for now.
  • Output formatting follows the chosen language. It was previously forced to de-DE, so English output now uses . decimals and English date formats.

Bug fixes

  • Config validation: the port range check used &&, so it could never fail. It now uses ||.
  • BCC: the "no BCC" marker was the localized word, so a config written in German (nein) crashed Bcc.Add in an English run. The setup now asks a yes/no question and stores an empty bcc for "no". Old no/nein values are still accepted.
  • Startup: Desktop\Reaper is created again. Nothing created it after the langFiles handling was removed, so the first config write failed.
  • API check: an HttpClient timeout throws TaskCanceledException, which the HttpRequestException catch missed, so the app carried on with the API unreachable. It now exits like other network errors.
  • APICall built a proxy handler but never passed it to the HttpClient. It is now used, so the default proxy and Windows credentials apply.
  • German resource entries DeviceOfflineDetails and ExceptionRaisedFormat now start with the same whitespace as the neutral resources.

Code quality

  • Fixed all IDE and CA diagnostics: IDE1006 (types, methods and properties are PascalCase, JSON keys are kept through [JsonPropertyName]), IDE0044, IDE0059, IDE0060, IDE0028, IDE0290, IDE0300, IDE0305, CA2211 and CA1854.
  • Fixed all nullable reference warnings. Model properties are initialized, ReadLine() results default to empty strings, and an empty weather response throws InvalidOperationException instead of a later NullReferenceException.
  • Removed the unused language list resources.

Framework

  • net6.0 to net8.0 to net10.0. SSH.NET 2026.0.0 needs a newer target than net6.0 (its System.Formats.Asn1 dependency produced a TFM warning).
  • main already contains the SSH.NET bump through Bump SSH.NET from 2020.0.2 to 2026.0.0 #1, so that commit overlaps with this branch. The merge is clean.

Behavior to be aware of

  • config.json keeps its existing keys, so existing configs still load.
  • A missing config key now reads as an empty string instead of null. CfgChecker treats both as missing.
  • The superuser mode no longer downloads language files.

Testing

Verified:

  • dotnet build on net10: 0 errors, 0 warnings. dotnet format style and analyzer checks report nothing at info severity.
  • JSON round trip for Config and the weather response model, run in a throwaway project, produces the same keys and values as before the renames.
  • An HttpClient timeout throws TaskCanceledException on .NET 8, which the new catch filter handles.

Not verified, because the app is interactive and needs live services. Please run these before merging:

  • First run from a clean state (delete Desktop\Reaper).
  • Superuser SFTP login (SSH.NET 2026 on net10).
  • BCC yes/no menu and sending a mail, in both languages.
  • Weather call, including behind a proxy.
  • German UI, including the offline and exception messages.

SebastianOehm and others added 19 commits February 21, 2026 01:23
- Implemented localization using RESX resource files (`Resources.resx` and `Resources.de.resx`) for multi-language support (e.g., de-DE).
- Removed `langVal` class and replaced hardcoded strings with resource-based localization.
- Added `LanguageLoader` class to handle language and culture settings dynamically.
- Migrated HTTP requests from `HttpWebRequest` to `HttpClient` for modernized and efficient networking.
- Improved error handling for network and HTTP exceptions with localized messages.
- Removed deprecated functions (`TranslationMaker`, `langHandler`) and unused dependencies.
- Optimized code with modern C# features (e.g., `string.IsNullOrEmpty`, String-Interpolation, `using` statements).
- Enhanced user interface with consistent and localized console output.
- Updated project file (`Reaper.csproj`) to support resource file integration and satellite assemblies.
- Improved SFTP integration with cleaner code and parameterized constructors.
- Overhauled mail functionality to use localized strings and improve usability.
- Ensured consistent naming conventions (e.g., `IRExcecute` -> `IRExecute`).
- Removed old language files and replaced them with resource-based localization.
Remove redundant comment
---
updated-dependencies:
- dependency-name: SSH.NET
  dependency-version: 2026.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
An empty bcc now means no BCC mail. The old marker was the localized
"no"/"nein", so a config written in one language crashed Bcc.Add when
used in the other. Legacy "no"/"nein" values are still accepted.
Properties keep their JSON keys through JsonPropertyName.
Use the proxy handler in APICall instead of leaving it unused.
Fixes IDE0028, IDE0290, IDE0300 and IDE0305.
A timeout throws TaskCanceledException, which the HttpRequestException catch missed, so the app continued with the API unreachable.
Nothing created it after the langFiles directory handling was removed, so the first config write failed.
Initialize model properties, default ReadLine results to empty strings, guard the default proxy and throw on an empty weather response.
DeviceOfflineDetails and ExceptionRaisedFormat lacked the leading line break of the neutral resources.
@SebastianOehm SebastianOehm self-assigned this Oct 3, 2026
@SebastianOehm
SebastianOehm merged commit 1daed46 into main Oct 3, 2026
2 checks passed
@SebastianOehm
SebastianOehm deleted the revamp branch October 3, 2026 20:44
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.

1 participant