Skip to content

android: externalize hardcoded UI strings#819

Open
foXaCe wants to merge 2 commits into
tailscale:mainfrom
foXaCe:feat/extract-hardcoded-strings
Open

android: externalize hardcoded UI strings#819
foXaCe wants to merge 2 commits into
tailscale:mainfrom
foXaCe:feat/extract-hardcoded-strings

Conversation

@foXaCe

@foXaCe foXaCe commented Jul 6, 2026

Copy link
Copy Markdown

What

Externalizes user-facing strings that were hardcoded in Kotlin/Java into
res/values/strings.xml, so they can be localized and pass the
HardcodedText lint check.

Changes

  • 10 new string resources (mostly accessibility contentDescriptions):
    MainView, TaildropView, PeerDetails, HealthView, LoginQRView,
    SharedViews, and the split-tunnel switch confirmation dialog title.
  • Reuse existing resources where they already exist:
    • search icons → R.string.search / R.string.clear_search
    • Quick Settings tile label → R.string.tile_name
  • French translations for the new keys added to res/values-fr/strings.xml.

No behavior change — the English strings are byte-for-byte identical to before.

Notes

Verification

  • No hardcoded UI strings remain (re-scan of Compose Text/contentDescription,
    setLabel/setTitle).
  • xmllint valid; EN↔FR key parity 317/317.
  • Imports added where needed (com.tailscale.ipn.R in SharedViews.kt).

@foXaCe foXaCe force-pushed the feat/extract-hardcoded-strings branch from 59a0a21 to 1af83f8 Compare July 6, 2026 09:25
foXaCe added 2 commits July 6, 2026 11:34
Add android/src/main/res/values-fr/strings.xml with the full French
localization of the app UI (307 translatable strings).

- Vouvoiement register, terminology consistent with Tailscale product
  terms kept in English (tailnet, Taildrop, exit node -> nœud de sortie,
  admin console -> console d'administration, etc.).
- Placeholders (%s, %d, %1$s, %.1f), XML entities and escaped apostrophes
  preserved; translatable="false" strings intentionally omitted.

Updates tailscale/tailscale#7856

Signed-off-by: Stéphane <foxace66@gmail.com>
Replace user-facing strings that were hardcoded in Kotlin/Java with
string resources so they can be localized.

- Extract 10 strings to res/values/strings.xml (mostly accessibility
  contentDescriptions across MainView, TaildropView, PeerDetails,
  HealthView, LoginQRView, SharedViews, plus the split-tunnel switch
  dialog title).
- Reuse existing resources where possible: R.string.search and
  R.string.clear_search for search icons, R.string.tile_name for the
  Quick Settings tile label.
- Add matching French translations in res/values-fr/strings.xml.

No behavior change: the English strings are identical to before.

Updates tailscale/tailscale#7856

Signed-off-by: Stéphane <foxace66@gmail.com>
@foXaCe foXaCe force-pushed the feat/extract-hardcoded-strings branch from 1af83f8 to 68f5bd6 Compare July 6, 2026 09:34
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