Skip to content

android(i18n): complete zh-rCN/zh-rTW, move hard-coded UI text to resources - #852

Open
SAGIRIxr wants to merge 4 commits into
librepods-org:android/rewritefrom
SAGIRIxr:i18n/zh-rewrite
Open

SAGIRIxr wants to merge 4 commits into
librepods-org:android/rewritefrom
SAGIRIxr:i18n/zh-rewrite

Conversation

@SAGIRIxr

@SAGIRIxr SAGIRIxr commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Update (Oct 27): merged the current android/rewrite (80aa746) to resolve conflicts, and caught up on what landed in the meantime. I translated the 46 strings that came in with theming, the proximity card and the connection rules, and extracted the Glass effects toggles in AppAccessibilitySettingsScreen (the TODO: extract strings there). This branch's no_battery_info is gone, since your battery_not_available covers the same text. You had already moved the notification's listening-mode actions onto resources, so that part is no longer in this diff.

What this does

Two commits on top of android/rewrite, plus a merge and a follow-up for what landed since:

1. android(i18n): complete zh-rCN / zh-rTW and route hard-coded UI text through resources

  • values-zh-rCN and values-zh-rTW are both at 472 / 472 translatable strings on the current head. Before this PR they had 340 and 238 against the base it started from.

  • Fixes a typo in the existing zh-rCN ear_detection: 自动人耳检测 → 自动入耳检测.

  • Marks the font family names (inter, roboto_flex*), material_symbols, and the two GMS font certificate arrays translatable="false", so they stop showing up as missing translations.

  • Moves user-visible literals in Kotlin onto string resources. These rendered in English regardless of locale:

    • quick settings tile labels (Off / Transparency / Adaptive / Noise Cancellation / Unknown, and the "Disconnected" subtitle)
    • the ongoing notification's one-letter battery labels (L: 80% R: 75%). English output is unchanged; other locales can now localize them.
    • the Glass effects list in AppAccessibilitySettingsScreen (Reduce transparency / Increase contrast / Show borders)
    • PressAndHoldSettings was showing a literal "Digital Assistant" even though R.string.digital_assistant already existed
    • head tracking screen (toggle label, Velocity, Test Head Gestures, plot legend, the yes/no gesture feedback)
    • hearing aid confirmation dialog, StyledConfirmationDialog default button texts
    • recording start/stop button, onboarding "Grant all", noise control widget configuration screen
    • contentDescriptions that TalkBack reads out (back, clear text, settings, close, send, permission icons, play/pause, start/stop)

    New keys: done, enable, close, send, clear_text, headset, disconnected, unknown, velocity, test_head_gestures, horizontal, vertical, enable_hearing_aid, enable_hearing_aid_description, start_recording, stop_recording, grant_all, widget_service_not_available, widget_no_devices_found, battery_short_{left,right,case,headset}, head_gesture_{yes,no}_detected, play_pause, start_stop, next, glass_effects, reduce_transparency, increase_contrast, show_borders.

2. android: don't clip the EQ band labels in transparency settings

Each EQ row is value | slider | "Band n", and the slider took fillMaxWidth(0.9f) of what the value label left over. The band label only got the remainder, so in zh-rCN "频段 1"–"频段 8" had their digits cut off. The slider now takes the remaining space with weight(1f), so the labels get their natural width in every locale.

Left in English on purpose

  • PrivacyPolicyPage — it's your legal text, so I didn't think it was mine to translate.
  • The debug screen, the [debug] controls, and @Preview sample text.
  • The GitHub-issue / billing-error templates in AppSettingsScreen that get sent to you.

Terminology and how this was checked

The translations were drafted with AI assistance. To address the concern you raised on #761, the zh-rCN additions were reviewed by a native Simplified Chinese speaker, both as a list against the English source and in the running app. That review is where the nod/shake wording for gesture feedback and the EQ clipping came from. The 46 strings and the Glass effects labels added in the Oct 27 update haven't been through that review yet.

For terms the existing file already uses, I kept them as they are (聆听模式, 通透模式, 自适应, 对话感知, 灵动岛, 点按 …) instead of reopening that discussion here.

zh-rTW has not been reviewed by a Taiwanese reader yet. It follows the wording already in the zh-rTW file (聽覺模式, 輕觸, 裝置, 小工具) and uses 動態島 for the island. A pass from someone in Taiwan would be welcome before merging.

Relation to #761

#761 also completes zh-rCN, but it is based on an older commit. Against the current head it is missing 67 strings and carries 11 removed keys, and its terminology was partly superseded by the wording that landed in the meantime. This PR starts from the current file instead. Thanks to @zyl6932 for the earlier pass. If you would rather land that one first, I'm happy to rebase this onto it.

Testing

  • Built assembleFossDebug and installed it on a Xiaomi 14 Pro (HyperOS 3 / Android 16). It launches without crashing, and the reviewer went through the app in zh-rCN.
  • Spot-checked the compiled resources with aapt2 dump resources for zh-rCN, zh-rTW and the default locale.
  • Confirmed on device after the fix: the EQ band labels in Customize Transparency Mode are no longer clipped, and the ongoing notification shows the localized battery labels and listening-mode actions.
  • Not checked on device yet: the QS tile and the widget configuration screen.
  • After the Oct 27 merge: compileFossDebugKotlin passes on the merged tree, and both locales check 472 / 472 with no duplicate keys. The merged build hasn't been installed on the device yet.

SAGIRIxr added 2 commits October 20, 2026 16:53
The slider took fillMaxWidth(0.9f) of whatever the value label left over, so the trailing band label only got the remainder and was cut off in scripts wider than Latin (e.g. 频段 1). Let the slider take the remaining space with weight(1f) instead.
…rough resources

Fills the remaining zh-rCN (60) and zh-rTW (162) strings, fixes the ear_detection typo (人耳 -> 入耳), and marks the font family names and the GMS font cert arrays translatable=false.

Moves user-visible literals in Kotlin onto string resources: the QS tile and notification listening-mode labels, the widget configuration screen, head tracking labels and gesture feedback, hearing aid confirmation, recording button, Grant all, and the contentDescriptions read by TalkBack. The ongoing notification's one-letter battery labels now come from resources as well; English output is unchanged.
SAGIRIxr added 2 commits October 27, 2026 23:03
# Conflicts:
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/components/primitives/StyledConfirmationDialog.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/components/primitives/StyledInputField.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/components/primitives/StyledScaffold.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/screens/DeviceListScreen.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/screens/apple/TransparencySettingsScreen.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/presentation/utils/BatteryTextGenerator.kt
#	android/app/src/main/kotlin/me/kavishdevar/librepods/services/LibrePodsService.kt
#	android/app/src/main/res/values/strings.xml
…ffect toggles

Covers the 46 strings that came in with theming, the proximity card and the connection rules, so zh-rCN and zh-rTW are at 472/472 again. Drops this branch's no_battery_info in favour of the battery_not_available that landed upstream for the same text, marks material_symbols translatable=false, and moves the hard-coded labels in the app accessibility screen's Glass effects list (the TODO there) onto resources.

@kavishdevar kavishdevar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove these comments

.padding(16.dp)
) {
val onBackground = MaterialTheme.colorScheme.onBackground
// the Canvas draw scope is not composable, so resolve the legend labels here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// the Canvas draw scope is not composable, so resolve the legend labels here

Comment on lines +306 to +307
// weight, not fillMaxWidth(0.9f): the band label after the slider
// only got the leftover width and was clipped in wider scripts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// weight, not fillMaxWidth(0.9f): the band label after the slider
// only got the leftover width and was clipped in wider scripts

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.

2 participants