Skip to content

fix(accounting): use translation keys for list screen titles and tooltips - #321

Merged
Aman-Mittal merged 1 commit into
apache:mainfrom
yasumorishima:i18n/accounting-list-screen-strings
Aug 10, 2026
Merged

Aman-Mittal merged 1 commit into
apache:mainfrom
yasumorishima:i18n/accounting-list-screen-strings

Conversation

@yasumorishima

Copy link
Copy Markdown
Contributor

What and why

The five accounting list screens passed English literals to app-data-table's title / createButtonLabel inputs and to ion-button title tooltips, so those strings stayed in English whichever language was selected. As #251 notes, this is worse than an ordinary missing translation: a missing key renders as a visible key and diagnoses itself, whereas a hardcoded string looks correct in every locale.

This replaces all 11 sites in src/app/features/accounting with translation keys. #251 says one PR per feature directory; accounting is the largest at 11 sites.

Part of #251.

The 11 replacements

File Was Now Key
accounting-closures-list title="Accounting Closures" nav.accountingClosures existing
accounting-closures-list createButtonLabel="Close Period" ACCOUNTING_CLOSURES.CREATE existing
accounting-closures-list title="Re-open Period" ACCOUNTING_CLOSURES.REOPEN new
chart-of-accounts title="Chart of Accounts" nav.chartOfAccounts existing
chart-of-accounts createButtonLabel="Add Ledger Account" ACCOUNTING.ADD_LEDGER_ACCOUNT new
chart-of-accounts title="Edit Account" ACCOUNTING.EDIT_ACCOUNT new
journal-entries-list title="Journal Entries" nav.journalEntries existing
journal-entries-list createButtonLabel="Add Journal Entry" JOURNAL_ENTRIES.CREATE existing
financial-activity-mappings-list title="Financial Activity Mappings" nav.financialActivityMappings existing
financial-activity-mappings-list createButtonLabel="Define Mapping" ACCOUNTING.DEFINE_MAPPING new
charges-list title="Edit Charge" CHARGES.EDIT existing

No visible English text changes. Every key resolves to the exact string it replaced, so in English this is a no-op and only the other locales change.

Two decisions worth a reviewer's eye

1. List screen titles reuse nav.* rather than new ACCOUNTING.* keys. #251 sketched title="ACCOUNTING.CHART_OF_ACCOUNTS", but 45 existing list screens already pass their nav.* entry as the data-table title (nav.groups, nav.users, nav.loanProducts, …), and nav.chartOfAccounts / nav.journalEntries / nav.accountingClosures / nav.financialActivityMappings already exist with byte-identical English. Reusing them follows both the issue's "reuse beats a near-duplicate" guidance and the dominant convention. Happy to switch to a new namespace if you prefer.

2. ADD_LEDGER_ACCOUNT / EDIT_ACCOUNT are new even though CREATE_GL_ACCOUNT / EDIT_GL_ACCOUNT exist. Those read "Create GL Account" / "Edit GL Account" and title the gl-account-form dialog these buttons open, so collapsing into them looked like the tighter catalogue. It would have broken a test: e2e/functional-coverage.spec.ts:839 drives this screen with getByRole('button', { name: /Add Ledger Account/i }). Keeping the English byte-identical is what makes this change safe. If you do want the wording unified, the e2e selector has to change in the same PR.

Verification

Run on a fork of this repository at the same commit — all 18 jobs green:

  • CI (12/12): Dependency Integrity, TS/ESLint, HTML Lint, Format Check, Unit Tests, Production Build, Translation Check, License Compliance, Apache RAT Scan, Security Audit, API Client Drift Check, Build Summary.
  • E2E (6/6): all four mocked shards, the mocked report, and E2E (real Fineract) against the docker-compose backend.

Additional checks made while preparing this:

  • node scripts/check-translations.mjs → Checked 1485 referenced keys against 2014 keys in en.json. ✓ No missing keys. This is a real gate here, not a formality: the checker's patterns match the title="KEY" / createButtonLabel="KEY" attribute forms, so every key introduced above is statically validated.
  • The grep in 31 hardcoded English strings on list screens ignore the language setting #251 drops from 31 sites to 20 repo-wide, and to 0 under src/app/features/accounting.
  • Every existing assertion that touches these strings was checked before changing them. The e2e suite drives all five screens by their English text (feature-coverage.spec.ts:414 asserts the card title; functional-coverage.spec.ts:785/816/839 click the create buttons by name) and each still matches because the keys resolve to the identical string. No unit spec under src/app asserts these literals.
  • The three converted title= → [title]= bindings use | appTranslate with TranslatePipe from src/app/core/adapters, per DOCS/ADAPTERS.md, and their attribute order matches existing prettier-stable elements of the same shape (groups-list L85-90, email-campaigns-list L115-119). Format Check passing confirms prettier is a no-op on this diff.

Screenshots

Not applicable — no visual change in English. The change is only observable by switching the language, where these strings now translate instead of staying English.

Checklist

  • I did not hand-edit generated files under src/app/api/.
  • New component or service code uses the adapter boundary in src/app/core/adapters/ instead of direct browser globals or imperative third-party APIs.
  • User-facing strings use translation keys.
  • I added or updated tests appropriate to this change, or explained why tests were not needed — there is no new behaviour and no visible string change, so the existing e2e specs that drive these screens by their English text are the regression test, and check-translations covers the new keys.
  • UI workflow changes include suitable e2e coverage — not applicable, no workflow change.
  • Commits are signed. The commit is SSH-signed, but the public key is not yet registered as a signing key on my GitHub account, so it currently displays as Unverified (GET /commits/:sha reports reason: "unknown_key", i.e. GitHub sees a valid signature it cannot attribute). Registering the key makes it verify retroactively with no rewrite of this branch, and I will do that shortly. Flagging it rather than ticking the box.

@Aman-Mittal

Copy link
Copy Markdown
Member

@yasumorishima please upload your signing key and remove claude co-authored in commit

This user has not yet uploaded their public signing key.
Learn about vigilant mode

…tips

The five accounting list screens passed English literals to `app-data-table`
`title`/`createButtonLabel` and to `ion-button` `title` tooltips, so those
strings stayed in English in every locale. Unlike a missing translation, a
hardcoded string looks correct in the UI and is only findable by grep.

Replaces all 11 sites in `src/app/features/accounting` with translation keys.
Seven reuse an existing key whose English text is identical, following the
established convention that a list screen title is its `nav.*` entry (45 other
screens already do this). Four keys had no exact match and are added to
`en.json`.

No visible English text changes: every replacement key resolves to the exact
string it replaced.

Part of apache#251.
@yasumorishima
yasumorishima force-pushed the i18n/accounting-list-screen-strings branch from 80688a7 to 91d2f84 Compare August 10, 2026 12:12
@yasumorishima

Copy link
Copy Markdown
Contributor Author

Thanks for the review — both are done.

  • Uploaded my SSH signing key, so 91d2f84 now shows as Verified.
  • Amended the commit message to drop the co-author trailer.

The amend touched the message only: the tree is unchanged at a29f6697, so there is no code difference from what you looked at. The workflows went back to action_required after the force-push and need approval to run again.

@Aman-Mittal
Aman-Mittal merged commit 7640c93 into apache:main Aug 10, 2026
21 checks passed
yasumorishima added a commit to yasumorishima/yasumorishima that referenced this pull request Aug 10, 2026
@yasumorishima
yasumorishima deleted the i18n/accounting-list-screen-strings branch November 11, 2026 02:37
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