Skip to content

refactor(settings): Use string resources for update intervals#3937

Merged
jamesarich merged 1 commit into
mainfrom
fix/interval-strings
Dec 9, 2025
Merged

refactor(settings): Use string resources for update intervals#3937
jamesarich merged 1 commit into
mainfrom
fix/interval-strings

Conversation

@jamesarich

@jamesarich jamesarich commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

Refactors the FixedUpdateIntervals enum to use string and plural string resources for localization, replacing the previous method of generating display names from the enum constant names.

  • Updated FixedUpdateIntervals enum to include textRes, pluralRes, and quantity parameters for mapping each interval to its corresponding string resource.
  • Created a new toDisplayString extension function that uses pluralStringResource and stringResource to provide localized interval names.
  • Added new string and plural resources for seconds, minutes, hours, "Unset", and "Always On" to strings.xml.

resolves #3841

@github-actions github-actions Bot added the bugfix PR tag label Dec 9, 2025
@codecov

codecov Bot commented Dec 9, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.52%. Comparing base (db0ae13) to head (0356818).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...stic/feature/settings/util/FixedUpdateIntervals.kt 0.00% 38 Missing ⚠️
...org/meshtastic/feature/settings/util/Formatting.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3937      +/-   ##
========================================
- Coverage   0.52%   0.52%   -0.01%     
========================================
  Files        394     394              
  Lines      23140   23145       +5     
  Branches    2933    2933              
========================================
  Hits         122     122              
- Misses     22997   23002       +5     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This commit refactors the `FixedUpdateIntervals` enum to use string and plural string resources for localization, replacing the previous method of generating display names from the enum constant names.

- Updated `FixedUpdateIntervals` enum to include `textRes`, `pluralRes`, and `quantity` parameters for mapping each interval to its corresponding string resource.
- Created a new `toDisplayString` extension function that uses `pluralStringResource` and `stringResource` to provide localized interval names.
- Added new string and plural resources for seconds, minutes, hours, "Unset", and "Always On" to `strings.xml`.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich force-pushed the fix/interval-strings branch from 7758c8a to 0356818 Compare December 9, 2025 20:14
@jamesarich jamesarich enabled auto-merge December 9, 2025 21:06
@jamesarich jamesarich added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit 1d8ae61 Dec 9, 2025
7 checks passed
@jamesarich jamesarich deleted the fix/interval-strings branch December 9, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Missing strings for translations - settings > dropdowns

1 participant