de and el navigate.yaml still use string-length($Prefix), which breaks as soon as their prefixes are translated
- Dominant language
- Rust
- Stars
- 114
- Forks
- 85
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 42
Description
`ec36e057` replaced `string-length($Prefix)+1` with `$CommandOffset` in
`navigate.yaml`, because `$NavCommand` is always English (`ZoomIn`, `MoveNext`)
while `$Prefix` is the spoken, translated word. `de` and `el` still carry the old
formula:
```
lang string-length($Prefix)+1 $CommandOffset Prefix words
de 9 0 zoom, move, read, describe
el 9 0 zoom, move, read, describe
en fr hu nb sv pl 0 9 (translated)
```
Right now both work, but only by coincidence: their `Prefix` values are still the
untranslated English words, so `string-length("move")` happens to equal the length
of the `Move` stem. The first translator who localizes them — the obvious thing to
do with a user-facing string — silently breaks every navigation announcement in
that language.
This is not hypothetical; it is exactly what `pl` was suffering from before #738.
With `Prefix: 'przejdź'` (7 chars) against the `Move` stem (4):
```
ZoomIn -> "" (want "In")
ZoomOutAll -> "ll" (want "OutAll")
MoveNext -> "t" (want "Next")
DescribeNext -> "ibeNext" (want "Next")
```
All 16 branches were dead, so users heard "przejdź; do mianownika" with no
direction word at all. Nothing failed: there were no navigation tests for `pl`,
and the 600+ speech tests were green throughout.
Two things might be worth doing:
1. Port `$CommandOffset` to `de` and `el` now, while their prefixes are still
English and the change is a no-op that can be verified as such.
2. Since the same trap can reappear in any new language, it might be worth
comparing against `$NavCommand` directly, the way `ru` does
(`$NavCommand = 'ZoomIn'`). More verbose, but it cannot be got wrong by
choosing a different word length.
I am happy to send a PR for point 1 if you would like it — it is mechanical, and
I would keep it to those two files.
For reference, `es`, `fi`, `id`, `vi` and `zz` do not use this construct at all.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the de and el navigate.yaml files and compare their prefix-offset handling with the corrected form from ec36e057, plus the pl change in #738. Run the existing speech tests and verify both languages retain their current behavior while their navigation branches remain correct if the prefixes are translated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100