Skip to content

Feat/extract strings - #27

Merged
professorDeveloper merged 2 commits into
masterfrom
feat/extract-strings
Sep 7, 2026
Merged

Feat/extract strings#27
professorDeveloper merged 2 commits into
masterfrom
feat/extract-strings

Conversation

@professorDeveloper

Copy link
Copy Markdown
Owner

No description provided.

Groundwork for translating the TV app. No visible text changes: every literal
lifted out becomes a string resource holding exactly the same words, and the
extraction was verified by building the app.

86 dead string resources deleted — leanback template leftovers (`browse_title`
= "Videos by Your Company", `rent_1`, `buy_2`, `lorem`, `hello_blank_fragment`)
and an Uzbek phone-login flow that was removed from the code long ago. Nothing
deleted is still referenced; the four that looked dead are `<plurals>`, reached
through `R.plurals` rather than `R.string`.

119 layout attributes (`android:text`, `hint`, `contentDescription`, and the
nav-graph `label`s) and 37 Kotlin literals now point at resources. What was
left alone on purpose: the on-screen keyboard's single letters, the `•` and `−`
separators, `"$value$unit"`, and the empty strings — none of them is language,
and turning them into resources would ask nine translators to translate a
punctuation mark.

`"${item.count} sources"` now goes through the `source_count` plurals that
already existed and was not being used at that call site, so a single source no
longer reads "1 sources".

Two extracted names had to be renamed because an Android resource name must
start with a letter: the layout-preview values "5 hours ago" and "16sp", both
overwritten at runtime.
Uzbek, Russian, German, Dutch, Spanish, Portuguese, French, Turkish and
Indonesian, alongside the English base — 3,312 translated strings across nine
`values-*` folders.

No Arabic. It needs a mirrored leanback layout and a font carrying its glyphs,
and neither is in this app; tying the other nine to that work would have held
all of them.

44 resources are deliberately left in English: the nav-graph destination labels
(never drawn on a leanback screen), brand names, the `•` separator, and the
layout-preview samples. Android falls back per key, so omitting them is the
right answer rather than a gap — and `tools/check_strings.py` knows the list,
because a check that reports a deliberate decision as debt trains people to
ignore it.

The picker sits in My Account rather than relying on the system's per-app
language setting. Android 13+ builds that entry from `locales_config.xml`, but
the device this matters most on is a cheap TV box that shipped in a language
its owner did not choose and would not know to change system-wide.
`AppCompatDelegate.setApplicationLocales` carries the same mechanism down to
this app's minSdk, so nothing is gated on 13.

Also caught while wiring it up: the base English file still held Uzbek in four
values ("Tv Kanallar", "Amallar", "soat", "daqiqa"), the content-controls
header built its summary from English literals, and six section titles were
hardcoded in custom layout attributes that the earlier extraction pass did not
know to look at.

The TV app had no CI at all, only a release workflow. It has one now: the
string check, and an assembleDebug — `mergeDebugResources` is where a duplicate
or badly named resource fails, and it fails for every locale at once. The check
blocks on a mismatched format specifier in any locale, because that throws at
`getString` time on that language only, and on keys missing from `uz`/`ru`,
which the team writes. The other seven are reported and fall back to English.
@professorDeveloper
professorDeveloper merged commit 37ab0b3 into master Sep 7, 2026
2 checks passed
@professorDeveloper
professorDeveloper deleted the feat/extract-strings branch September 7, 2026 20:24
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