Skip to content

fix(i18n): localize hardcoded widget text and harden string checks - #103

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/i18n-hardcoded-strings
Nov 20, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/i18n-hardcoded-strings

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Problem

In v3.0 the Russian widget showed English "Today"/"Tomorrow". These and other widget labels were hardcoded in Kotlin, so check_strings.py (which only compares XML files) could not see them.

Changes

  • Move hardcoded text to string resources, translated for all 10 locales:
    • Calendar: Today, Tomorrow, Today/Tomorrow + time, No events today, calendar permission prompt
    • Tasks: Overdue, Today, Tomorrow, Tasks.org permission prompt
    • Weather warnings: rain/snow/storm today, tomorrow, on ; Warning; Unknown
    • Celsius/Fahrenheit option, screen time units, widget error label
  • scripts/check_strings.py now also flags:
    • hardcoded English literals in Kotlin (suppress with // i18n-ignore or -start/-end blocks)
    • unused base strings (removed 9 found)
    • locale values identical to English (cognate allowlist SAME_AS_BASE_KEYS)
  • Regression test: Russian due-date labels (TasksFetcherTest)

Verification

  • python3 scripts/check_strings.py OK; run against v3.0 sources it flags every bug fixed here
  • ./gradlew --offline testDebugUnitTest pass, lintDebug no errors

Follow-up

Settings search matches only English keywords (SettingsSearch.kt); marked as intentional for now.

Calendar, tasks and weather labels (Today, Tomorrow, Overdue, rain/snow/storm
warnings, permission prompts), temperature unit names, screen time units and
the error label were hardcoded English in Kotlin, so no locale translated them.
Move them to string resources with translations for all 10 locales.

check_strings.py now also flags hardcoded English literals in Kotlin, unused
base strings and locale values left identical to English. Remove 9 unused
strings it found.
@LeanBitLab
LeanBitLab merged commit cce01a1 into main Nov 20, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/i18n-hardcoded-strings branch November 20, 2026 08:36
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