Skip to content

refactor(i18n): prune dead and orphaned keys, localize remaining strings, and add validation script - #1560

Open
abhayrajjais01 wants to merge 7 commits into
joinmarket-webui:develfrom
abhayrajjais01:refactor/i18n-audit-prune-keys
Open

abhayrajjais01 wants to merge 7 commits into
joinmarket-webui:develfrom
abhayrajjais01:refactor/i18n-audit-prune-keys

Conversation

@abhayrajjais01

Copy link
Copy Markdown
Contributor

Resolves #1554

Summary

Following up on the v2: Parity to Legacy roadmap item to adapt and rethink i18n keys, this PR performs a comprehensive audit of translation keys across the codebase:

  1. Pruned dead keys in en: Removed 7 unreferenced legacy strings that survived component refactors (create_wallet.alert_rescan_in_progress, create_wallet.feedback_valid, earn.fidelity_bond.select_date.warning_fb_with_same_expiry, earn.fidelity_bond.select_utxos.button_select_all, earn.fidelity_bond.select_utxos.button_deselect_all, navbar.title, and send.input_num_collaborators_placeholder).
  2. Cleaned up orphaned keys in non-English locales: Pruned stale v1 keys across de, fr, it, pt_BR, ru, zh_Hans, and zh_Hant that no longer exist in the English source, while preserving valid language-specific plural forms (such as confirmations_few and confirmations_many in Russian).
  3. Localize remaining hardcoded strings:
    • BetaInfoHeader: localized banner badge, text, and issue link button under beta_info.
    • RescanChainPage: localized preset block count buttons and Segwit activation tooltip under rescan_chain.button_preset_* and rescan_chain.tooltip_segwit_activation_block.
    • SettingsPage: localized Developer Mode title and toggle switch under settings.developer_mode_title and settings.developer_mode_switch_title.
  4. Automated validation tooling:
    • Added scripts/i18n-check.mjs (npm run i18n:check) to detect dead keys in English and orphaned keys in other locales. It accounts for dynamic prefixes (PasswordVerificationForm, PreconditionAlert, scheduler.status_, tx_history.label_role_, and jar_details.utxo_list.utxo_tag_tooltip_) and resolves recursive $t(...) translation string interpolations.
    • Added unit test src/i18n/keys.test.ts to guard against translation drift in npm test.
    • Integrated npm run i18n:check into package.json's check script and GitHub Actions CI workflow (.github/workflows/build.yml).

Key Verification Notes

During audit, several keys initially flagged as potentially dead were verified as actively required:

  • scheduler.status_* & tx_history.label_role_*: dynamically interpolated at runtime.
  • settings.seed_modal.verification.* & settings.xpubs_modal.verification.*: dynamically referenced via i18nKeyPrefix in PasswordVerificationForm.
  • send.coinjoin_precondition.nested_hint_*, scheduler.precondition.nested_hint_*, and earn.alert_bondless_maker_fees_info_description: actively resolved by i18next $t(...) nesting inside precondition and form validation strings.
  • jar_details.utxo_list.utxo_tag_tooltip_*: actively queried dynamically in JarUtxosTable and BranchEntryTable to display status badge tooltips.

All of these active keys were carefully preserved.

@abhayrajjais01
abhayrajjais01 marked this pull request as draft October 20, 2026 09:58
@abhayrajjais01
abhayrajjais01 changed the base branch from master to devel October 20, 2026 09:59
@abhayrajjais01
abhayrajjais01 marked this pull request as ready for review October 20, 2026 09:59
…add validation script (joinmarket-webui#1554)

- Prune 7 dead keys in en/translation.json that are no longer referenced.
- Prune orphaned legacy keys across all non-English translation files (de, fr, it, pt_BR, ru, zh_Hans, zh_Hant) while preserving valid Slavic plural forms.
- Localize hardcoded strings in BetaInfoHeader, RescanChainPage, and SettingsPage.
- Add an automated i18n validation script (scripts/i18n-check.mjs) and 'npm run i18n:check' command to detect dead or orphaned keys.
- Add unit test for translation key parity (src/i18n/keys.test.ts) and integrate check into CI.
@abhayrajjais01
abhayrajjais01 force-pushed the refactor/i18n-audit-prune-keys branch from 7057a21 to 25a2442 Compare October 31, 2026 14:10
…t-prune-keys

# Conflicts:
#	src/i18n/locales/de/translation.json
#	src/i18n/locales/en/translation.json
#	src/i18n/locales/fr/translation.json
#	src/i18n/locales/it/translation.json
#	src/i18n/locales/pt_BR/translation.json
#	src/i18n/locales/zh_Hans/translation.json
#	src/i18n/locales/zh_Hant/translation.json
…t-prune-keys

# Conflicts:
#	src/i18n/locales/fr/translation.json
#	src/i18n/locales/it/translation.json
#	src/i18n/locales/pt_BR/translation.json

This branch has not been deployed

No deployments
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