shivaansh0610-LUFFY opened a new pull request, #655:
URL: https://github.com/apache/fineract-backoffice-ui/pull/655
## What and why
68 labels and headings across 15 screens were English written straight into
a template, with no key and no pipe. Nothing looked them up, so they stayed
English in Hindi and Korean whatever the catalogue held, and no existing check
could see them (#652).
Each one now goes through a key in `en.json` and the pipe its file already
used: `| translate` where the file imports `TranslateModule`, `| appTranslate`
where it imports `TranslatePipe`. The two files that imported neither, and the
two that imported both, use `TranslatePipe` from `core/adapters`, so no new
`@ngx-translate` import is added to the lint baseline.
- 55 new keys, none removed or reworded. The rest reuse a key the screen's
own namespace, `COMMON` or `nav` already had. `COMMON.SUBMITTED_ON_DATE` is new
and shared by the reschedule form and the savings overview.
- Where a translated label has an `aria-label` repeating the same words
(`aria-label="Rule Name"`), the `aria-label` now follows the label. Translating
only the visible text would leave a Hindi label over an English accessible name.
- The English text on screen is unchanged.
Not in this PR:
- **`hi.json` / `ko.json`.** These are partial catalogues by design and
filling them is translator work. This makes the strings translatable; it does
not translate them.
- **`scripts/template-text-baseline.json`.** `check-template-text` comes
from #651, which hasn't merged. Whichever of the two lands second should run
`node scripts/check-template-text.mjs --update`; the 15 files drop to zero. The
checker also counts `clients-list`, `staff-form` and `view-payload-dialog` on
`main`. Those are fixed inside #651 and left alone here. Expect a textual
conflict with #651 in `accounting-closure-form.component.ts` and `en.json`.
- **Single-word English** (`Office`, `Description`, `Comment`, ...) and
conditional headings such as `{{ isEdit ? 'Edit' : 'Create' }} Accounting
Rule`, which the checker deliberately doesn't flag.
Closes #652
## Verification
- `npm run lint`, `npm run format:check`, `npm run i18n:check`, `npm run
check:icons`, `npm run check:a11y-names`, `bash scripts/check-license.sh` and
`npm run build` all pass.
- `npm run test:unit`: 275 files, 1769 tests pass. 15 specs assert that the
new keys render (6 existing specs extended, 9 new) using `expectLookedUp` in
`src/app/testing/translated-text.ts`. Against the old templates all 15 fail;
against this branch they pass.
- `node scripts/check-template-text.mjs --list` (from #651), run against
this branch: the 15 files report nothing and only the 3 files above remain.
- Mocked Playwright specs that cover two of the changed screens
(`functional-coverage.spec.ts`: closure form, audit-log filters) pass. No real
Fineract backend was used, and no other e2e spec was run.
- Exercised in the running app with the API mocked (`page.route`): each of
the 15 screens, with the language switched from English to Hindi in the header.
With a Hindi catalogue loaded, 66 of the 66 distinct strings stay English on
`main` and none do on this branch.
## Screenshots
Before and after for each screen in Hindi, plus a side-by-side recording.
Left is `main`, right is this branch.
The Hindi shown is a throwaway overlay merged over `hi.json` at the network
layer, to give the strings something to resolve to. It is not part of this
change and hasn't had a native review. The same overlay is applied to the
"before" build, where it has no effect because those strings have no key to
look up.
## AI assistance (optional)
- Tool / model:
- Harness / workflow:
## Checklist
- [x] I did not hand-edit generated files under `src/app/api/`.
- [x] New component or service code uses the adapter boundary in
`src/app/core/adapters/` instead of direct browser globals or imperative
third-party APIs.
- [x] User-facing strings use translation keys.
- [x] I added or updated tests appropriate to this change, or explained why
tests were not needed.
- [ ] UI workflow changes include suitable e2e coverage, including
real-backend testing where relevant. (No workflow changed; two existing mocked
specs re-run, as above.)
- [ ] Commits are signed — see [Commit
Signing](CONTRIBUTING.md#commit-signing) in CONTRIBUTING.md.
- [ ] I followed the [AI-assisted contributions
guidance](CONTRIBUTING.md#ai-assisted-contributions).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]