Aman-Mittal opened a new issue, #652:
URL: https://github.com/apache/fineract-backoffice-ui/issues/652

   ## Summary
   
   Split out of #651 rather than folded into it: the PR adds the check that 
finds these, and fixing 68 strings across 15 feature screens is separate, 
parallelisable work.
   
   These are labels and headings written directly into a template, with no key 
and no pipe:
   
   ```html
   <ion-label position="stacked">Repayments Rescheduling Rule</ion-label>
   ```
   
   Nothing is looked up, so nothing misses and no raw key ever appears. The 
screen renders correctly in English and stays English in Hindi and Korean 
indefinitely. This is the same defect as #627, which was found by hand on three 
screens; these are the rest.
   
   ## Why nothing reported them before #651
   
   - `i18n:check` MISSING verifies that keys referenced in code resolve — there 
is no key here.
   - `i18n:check` PHRASES checks that a `label:` literal is key-shaped — there 
is no `label:` here.
   - `ReportingMissingTranslationHandler` reports a key that resolves to 
nothing — `translate()` is never called.
   
   `npm run check:template-text` (added in #651) is what sees them. `node 
scripts/check-template-text.mjs --list` prints every occurrence with its line 
number.
   
   ## The 15 files
   
   | File | Occurrences |
   | ---- | ----------- |
   | `features/accounting/accounting-rule-form.component.ts` | 13 |
   | `features/loans/rescheduling/reschedule-form.component.ts` | 10 |
   | `features/products/savings-account-view.component.ts` | 10 |
   | `features/security/audit-logs/audit-logs-list.component.ts` | 7 |
   | `features/accounting/journal-entry-form.component.ts` | 5 |
   | `features/loans/point-in-time/loans-point-in-time.component.ts` | 5 |
   | `features/settings/working-days.component.ts` | 4 |
   | `features/accounting/charges/charge-form.component.ts` | 3 |
   | `features/accounting/accounting-closure-form.component.ts` | 2 |
   | `features/accounting/financial-activity-mapping-form.component.ts` | 2 |
   | `features/fintech/asset-owner-view/asset-owner-view.component.ts` | 2 |
   | `features/transfers/standing-instruction-form.component.ts` | 2 |
   | `features/campaigns/email-messages/email-messages.component.ts` | 1 |
   | `features/campaigns/sms-campaigns/sms-campaign-form.component.ts` | 1 |
   | `features/interop/interop-transfers.component.ts` | 1 |
   
   `features/settings/working-days.component.ts` is worth noting: #649 
translated the weekday labels there, and these four are the headings and rules 
on the same screen that were not part of that fix.
   
   ## Fix
   
   Per file: add keys to `src/assets/i18n/en.json` under the screen's existing 
namespace, replace the literal, and render it with the pipe **that file already 
imports** — `| appTranslate` where it imports `TranslatePipe` from 
`core/adapters`, `| translate` where it imports `TranslateModule`. Mixing the 
two in one file is the thing to avoid; `clients-list.component.ts` imports only 
`TranslatePipe`, so a `| translate` there does not compile.
   
   Then run:
   
   ```bash
   node scripts/check-template-text.mjs --update
   ```
   
   The baseline is per file and may only shrink, so the check fails until the 
lower number is recorded — which keeps the fix and the baseline in the same 
commit. One file per PR is fine and makes review easy.
   
   ## Scope
   
   Each file is independent, so this suits several contributors working in 
parallel. Reusing an existing key is usually right — `npm run i18n:check -- 
--unused` and a grep of `en.json` for the English string will often find one 
already defined.
   
   Note the check under-reports on purpose: it only flags text of two or more 
words starting with a capital, because a single word is too often a unit or 
acronym (`USD`, `ID`, `JSON`) to flag without a false-positive rate that would 
get the check switched off. So a screen cleared of its reported occurrences may 
still hold single-word English.


-- 
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]

Reply via email to