#439 and #444 translated the card titles, tooltips and aria-labels, but the field names inside the cards are still English literals. In frontend/src/components/views/ScanResults.tsx there are about 66 of them, almost all DtRow labels:
<DtRow label="Country" value={...} />
<DtRow label="Followers" value={...} />
<DtRow label="Total Stars" value={...} />
So someone using the Russian or Chinese interface gets a translated card title over a block of English field names. grep -noE 'label="[A-Z][a-z][^"]+"' frontend/src/components/views/ScanResults.tsx lists them with line numbers.
What to do:
- Replace each literal with
label={i18n('...')}.
- Many cards already have a key group under
results.* in messages/en.json (results.whois, results.github and so on); put the field keys there. Labels that repeat across cards, like Country, Name or Type, can share a key under results.fields.* instead of being added nine times.
- Every new key goes into all ten files in
messages/, real translations where you can and the English text where you cannot. npm run test:i18n checks that the locales line up. Edit the JSON by hand; re-saving it through a library rewrites the whole file.
This is a lot for one pull request. Splitting it by card is welcome; say in the PR which cards it covers so the next person can take the rest.
Done when that grep returns nothing for ScanResults.tsx and npm run build passes.
#439 and #444 translated the card titles, tooltips and aria-labels, but the field names inside the cards are still English literals. In
frontend/src/components/views/ScanResults.tsxthere are about 66 of them, almost allDtRowlabels:So someone using the Russian or Chinese interface gets a translated card title over a block of English field names.
grep -noE 'label="[A-Z][a-z][^"]+"' frontend/src/components/views/ScanResults.tsxlists them with line numbers.What to do:
label={i18n('...')}.results.*inmessages/en.json(results.whois,results.githuband so on); put the field keys there. Labels that repeat across cards, likeCountry,NameorType, can share a key underresults.fields.*instead of being added nine times.messages/, real translations where you can and the English text where you cannot.npm run test:i18nchecks that the locales line up. Edit the JSON by hand; re-saving it through a library rewrites the whole file.This is a lot for one pull request. Splitting it by card is welcome; say in the PR which cards it covers so the next person can take the rest.
Done when that grep returns nothing for
ScanResults.tsxandnpm run buildpasses.