From 095501fd766863f409805ea214edc3578c06c0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dziwisz?= Date: Mon, 14 Sep 2026 17:31:46 +0200 Subject: [PATCH] de, el: use $CommandOffset instead of string-length($Prefix) in navigate.yaml Ports ec36e057 to the two remaining languages that still cut the direction word out of $NavCommand with the length of the SPOKEN prefix. $NavCommand is always English (ZoomIn, MoveNext), while $Prefix is the translated word, so string-length($Prefix)+1 only lands on the right offset while the prefix happens to match the English stem. In de and el the prefixes are still the untranslated zoom/move/read/describe, so all 18 branches work today by coincidence; localizing those strings -- the obvious thing for a translator to do -- silently kills every direction word. This is a no-op right now, which is exactly why it is a good time to do it: substring($NavCommand, $CommandOffset) returns the same value as before for every one of the 15 navigation commands with the current prefixes. Verified on the engine, not only on paper: Languages::de is 209/209 both with and without this change. Greek has no tests at all (tests/Languages/el exists but is not declared in tests/languages.rs), so el rests on the structural check: offsets and the list of 9 branches are now identical to en. Refs #740. --- Rules/Languages/de/navigate.yaml | 26 +++++++++++++------------- Rules/Languages/el/navigate.yaml | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Rules/Languages/de/navigate.yaml b/Rules/Languages/de/navigate.yaml index 4ff42e67a..0b5ea83e8 100644 --- a/Rules/Languages/de/navigate.yaml +++ b/Rules/Languages/de/navigate.yaml @@ -54,37 +54,37 @@ else: - test: - if: "starts-with($NavCommand, 'Zoom')" - then: [set_variables: [Prefix: "'zoom'"]] # phrase('zoom' in to see more details) + then: [set_variables: [Prefix: "'zoom'", CommandOffset: "5"]] # phrase('zoom' in to see more details) - else_if: "starts-with($NavCommand, 'Move')" - then: [set_variables: [Prefix: "'move'"]] # phrase('move' to next entry in table) + then: [set_variables: [Prefix: "'move'", CommandOffset: "5"]] # phrase('move' to next entry in table) - else_if: "starts-with($NavCommand, 'Read')" - then: [set_variables: [Prefix: "'read'"]] # phrase('read' to next entry in table) + then: [set_variables: [Prefix: "'read'", CommandOffset: "5"]] # phrase('read' to next entry in table) - else_if: "starts-with($NavCommand, 'Describe')" - then: [set_variables: [Prefix: "'describe'"]] # phrase('describe' to next entry in table) + then: [set_variables: [Prefix: "'describe'", CommandOffset: "9"]] # phrase('describe' to next entry in table) - test: if: "$Prefix != ''" then: - x: "$Prefix" - test: - - if: "substring($NavCommand, string-length($Prefix)+1) = 'In'" + - if: "substring($NavCommand, $CommandOffset) = 'In'" then: [T: "in"] # phrase(zoom 'in' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'InAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'InAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" then: [T: "den ganzen weg"] # phrase(zoom 'out all the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Out'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Out'" then: [T: "raus"] # phrase(zoom 'out' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'OutAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'OutAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" then: [T: "den ganzen weg"] # phrase(zoom 'out all the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Next'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Next'" then: [T: "rechten"] # phrase(move to the 'right') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Previous'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Previous'" then: [T: "linken"] # phrase(move to the 'left') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Current'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Current'" then: [T: "aktuelle"] # phrase(who is the 'current' president) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineStart'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineStart'" then: [T: "start der linie"] # phrase(move 'to start of line') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineEnd'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineEnd'" then: [T: "bis zum ende der linie"] # phrase(move 'to end of line') - pause: "medium" - set_variables: [MatchCounter: "1"] diff --git a/Rules/Languages/el/navigate.yaml b/Rules/Languages/el/navigate.yaml index 2466efd8c..1cbfcc6f5 100644 --- a/Rules/Languages/el/navigate.yaml +++ b/Rules/Languages/el/navigate.yaml @@ -54,37 +54,37 @@ else: - test: - if: "starts-with($NavCommand, 'Zoom')" - then: [set_variables: [Prefix: "'zoom'"]] # phrase('zoom' in to see more details) + then: [set_variables: [Prefix: "'zoom'", CommandOffset: "5"]] # phrase('zoom' in to see more details) - else_if: "starts-with($NavCommand, 'Move')" - then: [set_variables: [Prefix: "'move'"]] # phrase('move' to next entry in table) + then: [set_variables: [Prefix: "'move'", CommandOffset: "5"]] # phrase('move' to next entry in table) - else_if: "starts-with($NavCommand, 'Read')" - then: [set_variables: [Prefix: "'read'"]] # phrase('read' to next entry in table) + then: [set_variables: [Prefix: "'read'", CommandOffset: "5"]] # phrase('read' to next entry in table) - else_if: "starts-with($NavCommand, 'Describe')" - then: [set_variables: [Prefix: "'describe'"]] # phrase('describe' to next entry in table) + then: [set_variables: [Prefix: "'describe'", CommandOffset: "9"]] # phrase('describe' to next entry in table) - test: if: "$Prefix != ''" then: - x: "$Prefix" - test: - - if: "substring($NavCommand, string-length($Prefix)+1) = 'In'" + - if: "substring($NavCommand, $CommandOffset) = 'In'" then: [t: "εντός"] # phrase(zoom 'in' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'InAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'InAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" then: [t: "\uF8FEed πλήρως"] #theodora. check # phrase(zoom 'out all the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Out'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Out'" then: [t: "εκτός"] # phrase(zoom 'out' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'OutAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'OutAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" then: [t: "\uF8FEed πλήρως"] #theodora. check # phrase(zoom 'out all the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Next'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Next'" then: [t: "δεξιά"] # phrase(move to the 'right') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Previous'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Previous'" then: [t: "αριστερά"] # phrase(move to the 'left') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Current'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Current'" then: [t: "τρέχον"] # phrase(who is the 'current' president) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineStart'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineStart'" then: [t: "στην αρχή της γραμμής"] # phrase(move 'to start of line') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineEnd'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineEnd'" then: [t: "στο τέλος της γραμμής"] # phrase(move 'to end of line') - pause: "medium" - set_variables: [MatchCounter: "$MatchCounter + 1"]