Skip to content

fix: localize user-facing and accessibility text (2/3) - #6025

Merged
2dust merged 6 commits into
2dust:masterfrom
eliotcougar:codex/issue-6005-localizable-ui-text
Aug 7, 2026
Merged

fix: localize user-facing and accessibility text (2/3)#6025
2dust merged 6 commits into
2dust:masterfrom
eliotcougar:codex/issue-6005-localizable-ui-text

Conversation

@eliotcougar

@eliotcougar eliotcougar commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Context

Partially fixes #6005.
Fixes #6022.

This is part 2 of 3 extracted from the original combined localization PR #6021. It follows the merged #6024 (part 1), which aligns the locale catalogs and repairs missing/divergent translations.

The branch has now been rebased onto current upstream/master after #6024 merged. Its commit list and Files changed view contain only the five focused part-2 commits.

Focused range: d8b857665c32f73d34dab220b324f54af336679a...5f7c8dc9c298dc3baf2d6bdabb0f39f5934cda64

What changed

Localize user-facing runtime text

  • Keeps startup and reload diagnostics in English for Logcat while exposing localized UI failures for missing server selections, profile decoding, config-context creation, normal config generation, empty custom configurations, and core startup failures.
  • Localizes the empty-detail fallback shown by connection tests.
  • Uses a localized Unknown fallback for missing country/IP data and an unavailable native-core version; the core-version API is now nullable instead of leaking an English sentinel into the UI.
  • Makes permission names (Camera, Notifications, and Local network) resources and formats permission-denied messages so each language can order the permission name naturally.
  • Moves malformed-JSON details into a formatted resource while retaining the generic fallback when no detail is available.
  • Localizes subscription-update status and progress notifications, including the active subscription/group context.
  • Localizes Tasker start/stop descriptions.

Give TalkBack controls dedicated descriptions

  • Adds clearly named acc_ resources whose wording describes the action or state when spoken aloud.
  • Separates accessibility descriptions from visible labels instead of reusing unrelated visual identifiers.
  • Covers main navigation and start/stop actions; back, search, add, more, edit, delete, and save actions; subscription and asset actions; routing controls; server/profile/group/custom-config actions; proxy-chain membership; per-app proxy controls; QR and scanner controls; and Logcat refresh/search/copy/share/clear controls.
  • Makes the scanner torch description state-aware (Turn torch on / Turn torch off).
  • Keeps visible UI resources intact; these changes apply only to accessibility semantics.
  • Removes the misleading Pull down to refresh toast shown when Logcat opens now that the screen exposes a dedicated refresh button, and gives that button the spoken description Refresh log.

Complete and review Bakhtiari (BQI) coverage

  • Translates every new part-2 user-facing and accessibility resource instead of leaving English placeholders.
  • Adds Bakhtiari translations for the newly exposed native-core error messages while preserving xray-core protocol names and other strictly technical tokens.
  • Replaces remaining Persian confirmation fallbacks and corrects stale or misleading wording for QUIC keys, fingerprints, Mux, FakeDNS, remote DNS, subscription remarks/filtering, running tests, Observatory input, and proxy-chain membership.
  • Normalizes Bakhtiari orthography across the full resource file using the conventions documented by Erik Anonby and Ashraf Asadi, while retaining established Persian/Arabic spellings in loanwords where the orthography calls for them.

Orthography references used for the BQI review:

Scope and sequencing

  • Part 1 — fix: sync locale resources and translations (1/3) #6024 (merged): align locale catalogs, fill missing translations/fallbacks, correct divergent meanings, and mark invariant technical values non-translatable.
  • Part 2 — this PR: extract hardcoded user-facing text, introduce dedicated accessibility descriptions, and complete the corresponding translations.
  • Part 3 — forthcoming: apply the selected locale consistently outside activities/services and contain the remaining locale-context mechanics from fix: complete localization resource audit #6021.

The logical part-2 diff changes 30 Kotlin files and the nine maintained strings.xml catalogs. It introduces 49 referenced resource identifiers and leaves each catalog with the same 448-resource sequence and row layout established by part 1.

Impact

  • Users no longer receive English-only runtime errors, permission messages, notification text, or fallback values where a localized resource is appropriate.
  • TalkBack announces controls as meaningful actions and states instead of reading visual labels or ambiguous nouns.
  • Translators receive explicit identifiers and formatter contracts for each newly localizable message.
  • Technical xray-core terminology remains unchanged where translation would reduce clarity or compatibility.

Validation

  • :app:processPlaystoreDebugResources
  • :app:compilePlaystoreDebugKotlin --no-daemon --stacktrace
  • git diff --check
  • Parsed all nine locale XML files successfully.
  • Verified the same 448 resource identifiers, node types, ordering, and source rows in every locale.
  • Verified matching translatable/formatted attributes, format placeholders, string-array/plural shapes, and identical values for translatable="false" resources.
  • Verified all 49 resources introduced by part 2 are referenced outside their declarations.
  • Verified the part-2 diff adds no hardcoded contentDescription literals.
  • Verified Logcat receives the unlocalized diagnostic for each localized startup, reload, and subscription-progress UI message.

@eliotcougar

Copy link
Copy Markdown
Contributor Author

As a small follow-up addition, I instructed GPT5.6 to download and read a bunch of academic linguistic materials about Bakhtiari dialect phonology, orthography, and lexicon. Hopefully, it managed to clean up the majority of Persian and Arabic calques. If a native speaker can take a look, that would be great.

@eliotcougar
eliotcougar marked this pull request as ready for review August 5, 2026 16:12
@2dust

2dust commented Aug 6, 2026

Copy link
Copy Markdown
Owner

rebase 到最新的 2dust:master

Replace the remaining Persian confirmation fallbacks, correct stale or mismatched UI meanings, and normalize established Bakhtiari terms without translating xray-core identifiers.

Primary source: Erik Anonby and Ashraf Asadi, Bakhtiari Studies II: Orthography (2018), sections 6.1.1, 6.8.1, 6.8.2, 6.8.7, and 6.8.9. https://www.diva-portal.org/smash/get/diva2%3A1231755/FULLTEXT02.pdf

The standard recommends that "Arabic letters be retained for Bakhtiari words borrowed from Persian" and reports that speakers view soft d as "a defining feature of how the language is pronounced."

Lexicon and phonology source: Erik Anonby and Ashraf Asadi, Bakhtiari Studies: Phonology, Text, Lexicon (2014). https://uu.diva-portal.org/smash/record.jsf?pid=diva2%3A758171

Historical corroboration: D. L. R. Lorimer, The Phonology of the Bakhtiari, Badakhshani, and Madaglashti Dialects of Modern Persian (1922). https://archive.org/details/phonologyofbakht06loriuoft
@eliotcougar
eliotcougar force-pushed the codex/issue-6005-localizable-ui-text branch from aae0a4e to fba58ad Compare August 6, 2026 09:42
@eliotcougar

Copy link
Copy Markdown
Contributor Author

rebase 到最新的 2dust:master

It's ready...

Comment thread V2rayNG/app/src/main/java/com/v2ray/ang/ui/main/MainServerPager.kt Outdated
private fun launchCore(service: Service, vpnInterface: ParcelFileDescriptor?, isReload: Boolean = false) {
val guid = MmkvManager.getSelectServer() ?: error("No server selected")
val config = MmkvManager.decodeServerConfig(guid) ?: error("Failed to decode server config")
val guid = MmkvManager.getSelectServer()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

我认为 core 里面这些字符串不应该处理。
因为这些有部分是会写入logcat ,这样会导致 log 中出现非英文内容; 且提示了给用户,用户也看不明白。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can separate user-visible error text and Logcat error text? See the new commit.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

看到了。
完全没有必要做的这样复杂,用户无需知道这么详细的错误信息;应该直接在最后提示启动失败,然后去查看日志,因为日志中才会有完整的内容。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

另外,这种单例和服务代码中,尽量还是不引入 string ,原来已有的地方也要考虑移除掉。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

另外,这种单例和服务代码中,尽量还是不引入 string ,原来已有的地方也要考虑移除掉。

Got it. I'll see what is left in terms of localization tomorrow. Looks like part 3 won't add anything. I'll probably just clean up unused strings added in part 2, and compile it to see how everything fits. Then we can call localization audit complete.

@2dust
2dust merged commit 775546c into 2dust:master Aug 7, 2026
1 check passed
2dust added a commit that referenced this pull request Aug 7, 2026
@eliotcougar
eliotcougar deleted the codex/issue-6005-localizable-ui-text branch August 7, 2026 10:04
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.

TalkBack accessibility regression since v2.3.1 (worked well in v2.2.6) Sync translation file from values

2 participants