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:
- 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.
- 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.
ec36e057replacedstring-length($Prefix)+1with$CommandOffsetinnavigate.yaml, because$NavCommandis always English (ZoomIn,MoveNext)while
$Prefixis the spoken, translated word.deandelstill carry the oldformula:
Right now both work, but only by coincidence: their
Prefixvalues are still theuntranslated English words, so
string-length("move")happens to equal the lengthof the
Movestem. The first translator who localizes them — the obvious thing todo with a user-facing string — silently breaks every navigation announcement in
that language.
This is not hypothetical; it is exactly what
plwas suffering from before #738.With
Prefix: 'przejdź'(7 chars) against theMovestem (4):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:
$CommandOffsettodeandelnow, while their prefixes are stillEnglish and the change is a no-op that can be verified as such.
comparing against
$NavCommanddirectly, the wayrudoes(
$NavCommand = 'ZoomIn'). More verbose, but it cannot be got wrong bychoosing 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,viandzzdo not use this construct at all.