Skip to content

i18n: localize legacy channel names/descriptions + ringtone "None" (#165)#191

Merged
almothafar merged 1 commit into
masterfrom
165-i18n-legacy-channel-strings
Jul 19, 2026
Merged

i18n: localize legacy channel names/descriptions + ringtone "None" (#165)#191
almothafar merged 1 commit into
masterfrom
165-i18n-legacy-channel-strings

Conversation

@almothafar

Copy link
Copy Markdown
Owner

Closes #165.

Problem

The three oldest notification channels (critical / warning / full) had their names and descriptions hard-coded in English in NotificationService, where lint can't see them. Arabic users saw English rows in system Settings → Notifications. The RingtonePreference fallback summary was likewise a hard-coded "None".

Changes

  • Six channel strings → resources with values-ar translations (critical/warning/full × name+description), and the three legacy channels now read them via context.getString(...).
  • Translated names on upgraded installs, not just fresh ones. The channel helpers no longer early-return when the channel already exists. Re-calling createNotificationChannel with the same ID updates only name/description/group — Android ignores importance, vibration, lights and sound — so the Vibrate toggle can't take effect: deleted notification channels resurrect with their old settings #153 versioning and any user customization are preserved. Renamed to createOrUpdateAlertChannel / createOrUpdateSilentChannel to reflect the honest semantics. This benefits every channel (e.g. a locale switch now refreshes all names on next service start), not only the three legacy ones.
  • Ringtone fallback reuses the existing (previously orphaned, already-translated) pref_ringtone_silent string instead of a literal "None". Visible text changes "None" → "Silent", which also matches the label on the system picker's own silent option.
  • Debug-only literals in BatteryInsightsActivity (options array, "Reset ALL health data?" dialog + toasts) are commented as deliberately untranslated so future i18n sweeps skip them knowingly.

Acceptance criteria

  • All three legacy channel names/descriptions come from resources, Arabic included
  • "None" summary localized (now "Silent" / "صامت")
  • Translated channel names visible on an upgraded install (not only fresh) — code handles it (early-return removed); needs on-device verification
  • Deliberately-untranslated debug strings commented as such

Verification

./gradlew :app:lintDebugBUILD SUCCESSFUL, no MissingTranslation errors (the repo treats that as an error, so a clean pass confirms every new string is translated). Compiles clean.

Still needs on-device testing: install a build without this change, then install this build over it in an Arabic locale, and confirm the three channels flip to Arabic in Settings → Notifications on the upgraded install.

Notes for review

  • Arabic strings drafted by Claude — pending maintainer review.
  • The "None" → "Silent" wording change is a deliberate call (reuses an orphaned string, matches the picker); flag if you'd prefer the literal "None" preserved.

Related: #153 (channel recreation), #96/#98 (locale work), #42 (Arabic localization).

🤖 Generated with Claude Code

)

The three oldest notification channels (critical/warning/full) had their
names/descriptions hard-coded in English in NotificationService, so an
Arabic user saw English rows in system Settings → Notifications. Move the
six strings to resources with values-ar translations and wire them up.

To make translated names reach *upgraded* installs (not just fresh ones),
the channel helpers no longer early-return when the channel already
exists: re-calling createNotificationChannel with the same ID updates only
name/description/group (Android ignores importance/vibration/lights/sound),
so the #153 versioning and user customizations are preserved. Renamed to
createOrUpdateAlertChannel / createOrUpdateSilentChannel to match.

Ringtone fallback summary now reuses the existing (previously orphaned)
pref_ringtone_silent string instead of a hard-coded "None", matching the
system picker's own "Silent" option.

Debug-only literals in BatteryInsightsActivity are commented as
deliberately untranslated so future i18n sweeps skip them knowingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@almothafar
almothafar merged commit 2116e72 into master Jul 19, 2026
2 checks passed
@almothafar
almothafar deleted the 165-i18n-legacy-channel-strings branch July 19, 2026 00:08
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.

i18n: user-visible strings hard-coded in English (legacy channel names/descriptions, ringtone "None")

1 participant