Skip to content

de and el navigate.yaml still use string-length($Prefix), which breaks as soon as their prefixes are translated #740

Description

@michaldziwisz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions