fix(i18n): the corridor's truncation note takes a singular, and three plurals were wrong anyway

`mobileTrip.rtTruncated` interpolated a count into a sentence naming the stretch once, so at
one truncated area it read "1 stretches". Two keys now, picked by the count, the shape this
codebase already uses where a number changes its noun.

Writing the singular turned up three plurals that were wrong at counts the old one-form key
could never reach. Polish and Czech both had the genitive plural with a singular verb, which
is right at five and wrong at two; Arabic had the 3 to 10 form, wrong at two and again from
eleven. All three now put the count after a colon, where no form has to agree with it.
Russian and Ukrainian were already correct at both, since their phrase leads with a
locative, and were left alone.

The eight languages that keep the singular noun after a numeral differ only in the numeral,
which is what they should do.
This commit is contained in:
Maurice
2026-09-17 16:40:05 +02:00
parent 92ccd24eed
commit c8f9edad87
25 changed files with 82 additions and 28 deletions
@@ -187,7 +187,15 @@ function StatusBand({ corridor, t }: { corridor: MRtCorridorController; t: Trans
// The phone's own wording, because the desk's ends in "narrow the corridor" and the
// corridor width is a control this screen deliberately does not have. What it does
// have is the category chips, and fewer of them really is what makes a box fit.
if (corridor.truncatedAreas > 0) notes.push(t('mobileTrip.rtTruncated', { count: corridor.truncatedAreas }))
// Two keys picked by the count: the i18n layer has no plural engine, so a single key
// with {count} in a sentence that names the noun once reads as "1 stretches".
if (corridor.truncatedAreas > 0) {
notes.push(
t(corridor.truncatedAreas === 1 ? 'mobileTrip.rtTruncated.one' : 'mobileTrip.rtTruncated.other', {
count: corridor.truncatedAreas,
}),
)
}
if (corridor.offline) return <Note tone="warn" icon={<WifiOff size={13} strokeWidth={2} />}>{t('mobileTrip.rtSearchOffline')}</Note>
if (corridor.error) return <Note tone="warn" icon={<AlertTriangle size={13} strokeWidth={2} />}>{t('roadtrip.poi.failed')}</Note>
@@ -141,11 +141,18 @@ describe('MRtCorridorSheet', () => {
expect(screen.getByText('roadtrip.poi.capped')).toBeInTheDocument()
expect(screen.getByText('roadtrip.poi.partial:2')).toBeInTheDocument()
// The phone's own wording: the desk's ends in "narrow the corridor", and the
// corridor width is a control this screen does not have.
expect(screen.getByText('mobileTrip.rtTruncated:1')).toBeInTheDocument()
// corridor width is a control this screen does not have. One stretch takes the
// singular key, because one key with {count} in it would read as "1 stretches".
expect(screen.getByText('mobileTrip.rtTruncated.one:1')).toBeInTheDocument()
expect(screen.queryByText('roadtrip.poi.truncated:1')).toBeNull()
})
it('FE-MOB-RTSRCH-011b: more than one truncated stretch takes the plural key', () => {
renderSheet({ answered: true, hits: [hit()], truncatedAreas: 3 })
expect(screen.getByText('mobileTrip.rtTruncated.other:3')).toBeInTheDocument()
})
it('FE-MOB-RTSRCH-012: a hit says what it is and where on the drive it sits', () => {
renderSheet({ answered: true, hits: [hit()] })