From 63a2f866441e98691b763f65f2fce4de8dcadb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 19 Sep 2026 20:22:27 +0900 Subject: [PATCH] ja: mark the reviewed navigation strings as verified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lowercase `t:` means untranslated or unverified and uppercase `T:` means translated and verified, so this is a review rather than bookkeeping. Each of the twenty-three lines was read against the value the English source carries in the same rule -- the value, not the `phrase(...)` hint, because those two can disagree: move-cell-next says "no next column" under a hint that reads "no next row", and the Japanese follows the value. Nineteen lines were already right and only change case. Four were the odd one out among their own siblings and are reworded as well: 最初の文字にズームイン -> 最初の文字までズームしました the other two zoom reports in that same test are sentences (ズームインを最大にしました, 文字までズームしました); this one was a bare noun phrase and did not read as a report of where the zoom ended up. 現在のエントリを読む -> 現在のセルを読む エントリ appears exactly once in the whole Japanese rule set. The rule speaks 行 and 列 straight after it, and the sibling rule says 表, so セル is the word these rules already use for the thing being read. シンプル -> 簡易 the three navigation modes are spoken as + モード, and 文字 and 拡張 are ordinary words while this one was a transliteration between them. 移動後の式の概要 -> 移動後に式の概要を読み上げる the two states of one toggle: the other is the sentence 移動後に式を読み上げる, and this one did not say what would happen to it. There is no Japanese appendix for navigation wording, unlike the ClearSpeak terms, so those four are a judgement call and each one has a test. audit-translations ja: untranslated 3415 -> 3392, which is exactly the number of lines promoted; rule differences unchanged at 30; missing, extra and definition counts unchanged at 0. Tests: four in navigate.rs. Reaching the first-character branch needs Character mode, so the helpers grew a mode argument; the sequence is the one move_inside_leaves in src/navigate.rs uses -- ZoomInAll to the leaf, then one more ZoomIn to step inside it. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01XzNYYoiVRzKGnDEWTJnuHh --- Rules/Languages/ja/navigate.yaml | 46 ++++++++++++++-------------- tests/Languages/ja/navigate.rs | 52 ++++++++++++++++++++++++++++++-- 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/Rules/Languages/ja/navigate.yaml b/Rules/Languages/ja/navigate.yaml index 11c17d776..ad14b4d56 100644 --- a/Rules/Languages/ja/navigate.yaml +++ b/Rules/Languages/ja/navigate.yaml @@ -55,7 +55,7 @@ - if: "string-length(.) = 1" then: [T: "ズームインを最大にしました"] # phrase('zoomed in all of the way') - else_if: "$NavNodeOffset = 0" - then: [t: "最初の文字にズームイン"] # phrase('zoomed in to first character') + then: [T: "最初の文字までズームしました"] # phrase('zoomed in to first character') else: [T: "文字までズームしました"] # phrase('zoomed in to character') - pause: "medium" else: @@ -577,7 +577,7 @@ - if: "$NavCommand = 'MoveStart'" then: [T: "数式の先頭に移動"] # phrase('move to start of math') - else_if: "$NavCommand = 'MoveLineStart'" - then: [t: "行の先頭に移動"] # phrase('move to start of line') + then: [T: "行の先頭に移動"] # phrase('move to start of line') - else_if: "$NavCommand = 'MoveEnd'" then: [T: "数式の末尾に移動"] # phrase('move to end of math') else: [T: "行の末尾に移動"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line') @@ -620,7 +620,7 @@ then: - test: if: "$NavCommand = 'MoveLineStart'" - then: [t: "行の先頭に移動"] # phrase('move to start of line') + then: [T: "行の先頭に移動"] # phrase('move to start of line') else: [T: "行の末尾に移動"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line') - pause: "medium" - test: @@ -671,7 +671,7 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "左に移動" # phrase('move left') + - T: "左に移動" # phrase('move left') - pause: short - test: if: "$NavVerbosity != 'Terse'" @@ -701,7 +701,7 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "右に移動" # phrase('move right') + - T: "右に移動" # phrase('move right') - pause: short - test: if: "$NavVerbosity != 'Terse'" @@ -718,7 +718,7 @@ else: - set_variables: [NavNode: "following-sibling::*[1]/*[1]/@id"] else: - - t: "次の列はありません" # phrase('no next column' in the table) + - T: "次の列はありません" # phrase('no next column' in the table) - set_variables: [SpeakExpression: "'false'"] - name: move-cell-up @@ -739,7 +739,7 @@ - test: if: "$NavVerbosity != 'Terse'" then: - - t: "行" # phrase(the previous 'row' in the table) + - T: "行" # phrase(the previous 'row' in the table) - x: "count(../preceding-sibling::*)" - pause: short - T: "列" # phrase(the previous 'column' in the table) @@ -775,7 +775,7 @@ - test: if: "$NavVerbosity != 'Terse'" then: - - t: "行" # phrase(the next 'row' in the table) + - T: "行" # phrase(the next 'row' in the table) - x: "count(../preceding-sibling::*)+2" - pause: short - T: "列" # phrase(the next 'column' in the table) @@ -800,7 +800,7 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "前の行に移動" # phrase('move to previous row' in the table) + - T: "前の行に移動" # phrase('move to previous row' in the table) - pause: medium - test: if: "preceding-sibling::*" @@ -824,7 +824,7 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "次の行に移動" # phrase('move to next row' in the table) + - T: "次の行に移動" # phrase('move to next row' in the table) - pause: medium - test: if: "following-sibling::*" @@ -849,7 +849,7 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "前の列に移動" # phrase('move to previous column' in the table) + - T: "前の列に移動" # phrase('move to previous column' in the table) - pause: medium - T: "前の列はありません" # phrase('no previous column' in the table) - set_variables: [SpeakExpression: "'false'"] @@ -862,9 +862,9 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "次の列に移動" # phrase('move to next column' in the table) + - T: "次の列に移動" # phrase('move to next column' in the table) - pause: medium - - t: "次の列はありません" # phrase('no next row' in the table) + - T: "次の列はありません" # phrase('no next row' in the table) - set_variables: [SpeakExpression: "'false'"] - name: default-read-cell @@ -880,12 +880,12 @@ - test: if: "$NavVerbosity = 'Verbose'" then: - - t: "現在のエントリを読む" # phrase('read current entry' in the table) + - T: "現在のセルを読む" # phrase('read current entry' in the table) - pause: medium - test: if: "$NavVerbosity != 'Terse'" then: - - t: "行" # phrase(the previous 'row' in the table) + - T: "行" # phrase(the previous 'row' in the table) - x: "count($MTD[1]/../preceding-sibling::*)+1" - pause: short - T: "列" # phrase(the previous 'column' in the table) @@ -1210,7 +1210,7 @@ - test: if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'" then: - - t: "右に移動できません" # phrase('cannot move right') + - T: "右に移動できません" # phrase('cannot move right') - pause: medium - with: variables: @@ -1428,7 +1428,7 @@ - test: if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose' and $NavCommand = 'MovePrevious'" then: - - t: "左に移動できません" # phrase('cannot move left' in expression) + - T: "左に移動できません" # phrase('cannot move left' in expression) - pause: medium - with: variables: @@ -1458,7 +1458,7 @@ - test: if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'" then: - - t: "左に移動できません" # phrase('cannot move left') + - T: "左に移動できません" # phrase('cannot move left') - pause: short - with: variables: [Move2D: "'start of'", Child2D: "."] @@ -1644,12 +1644,12 @@ - set_variables: [NavMode: "'Character'", ReadZoomLevel: "1"] - else_if: "$NavMode = 'Character'" then: - - t: "シンプル" # phrase(a 'simple' way to do something) + - T: "簡易" # phrase(a 'simple' way to do something) - set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"] - else: - T: "拡張" # phrase(an 'enhanced' way to do something) - set_variables: [NavMode: "'Enhanced'", ReadZoomLevel: "-1"] - - t: "モード" # phrase(a simple 'mode' of use) + - T: "モード" # phrase(a simple 'mode' of use) - pause: long - test: - if: "$NavMode != 'Enhanced'" # potentially need to zoom to the sibling @@ -1665,7 +1665,7 @@ - test: - if: "$NavMode = 'Enhanced'" then: - - t: "シンプル" # phrase(a 'simple' way to do something) + - T: "簡易" # phrase(a 'simple' way to do something) - set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"] - else_if: "$NavMode = 'Character'" then: @@ -1674,7 +1674,7 @@ - else: - T: "文字" # phrase(a mathematical 'character') - set_variables: [NavMode: "'Character'", ReadZoomLevel: "1"] - - t: "モード" # phrase(a simple 'mode' of use) + - T: "モード" # phrase(a simple 'mode' of use) - pause: long - test: - if: "$NavMode != 'Enhanced'" # potentially need to zoom to the sibling @@ -1694,7 +1694,7 @@ - pause: long - set_variables: [Overview: "'false'"] else: - - t: "移動後の式の概要" # phrase('overview of expression after move') + - T: "移動後に式の概要を読み上げる" # phrase('overview of expression after move') - pause: long - set_variables: [Overview: "'true'"] diff --git a/tests/Languages/ja/navigate.rs b/tests/Languages/ja/navigate.rs index 32ca5edc3..b90aaea27 100644 --- a/tests/Languages/ja/navigate.rs +++ b/tests/Languages/ja/navigate.rs @@ -11,11 +11,15 @@ use anyhow::Result; use std::panic::{catch_unwind, AssertUnwindSafe}; fn init_nav(mathml: &str) -> Result<()> { + init_nav_in_mode(mathml, "Enhanced") +} + +fn init_nav_in_mode(mathml: &str, nav_mode: &str) -> Result<()> { set_rules_dir(abs_rules_dir_path())?; set_preference("Language", "ja")?; set_preference("SpeechStyle", "SimpleSpeak")?; set_preference("Verbosity", "Medium")?; - set_preference("NavMode", "Enhanced")?; + set_preference("NavMode", nav_mode)?; set_preference("NavVerbosity", "Verbose")?; set_preference("AutoZoomOut", "False")?; set_preference("Overview", "False")?; @@ -24,9 +28,13 @@ fn init_nav(mathml: &str) -> Result<()> { } fn assert_command_prefix(mathml: &str, commands: &[&str], expected: &str) -> Result<()> { + assert_command_prefix_in_mode(mathml, "Enhanced", commands, expected) +} + +fn assert_command_prefix_in_mode(mathml: &str, nav_mode: &str, commands: &[&str], expected: &str) -> Result<()> { init_panic_handler(); let result = catch_unwind(AssertUnwindSafe(|| { - init_nav(mathml)?; + init_nav_in_mode(mathml, nav_mode)?; let mut speech = String::new(); for command in commands { speech = do_navigate_command(command)?; @@ -54,6 +62,12 @@ fn assert_speech(mathml: &str, commands: &[&str], expected: &str) -> Result<()> const EXPR: &str = r#"x2+1"#; +/// A leaf with more than one character, so that zooming in has a first +/// character to land on. +const MULTI_CHAR: &str = r#"xy+1"#; + +const TABLE: &str = r#"1234"#; + /// The prefix used to be the English word "zoom", spoken as-is by a Japanese /// synthesiser. ズーム + イン also reads as the ordinary loanword. #[test] @@ -120,3 +134,37 @@ fn placemarker_names_the_placeholder_first() -> Result<()> { fn reading_a_placemarker_names_it_first() -> Result<()> { assert_speech(EXPR, &["SetPlacemarker3", "Read3"], "プレースホルダー 3 を 読み上げ; x の 2 乗 プラス 1") } + +/// Character mode steps inside a leaf: ZoomInAll reaches the leaf, and one more +/// ZoomIn lands on its first character (the same sequence as move_inside_leaves +/// in src/navigate.rs). The other two zoom reports are sentences +/// (ズームインを最大にしました, 文字までズームしました); this one was a bare noun +/// phrase, so it did not read as a report of where the zoom ended up. +#[test] +fn zooming_to_the_first_character_reports_it() -> Result<()> { + assert_command_prefix_in_mode( + MULTI_CHAR, "Character", &["ZoomInAll", "ZoomIn"], "最初の文字までズームしました") +} + +/// The three navigation modes are spoken as + モード. 文字 and 拡張 are +/// ordinary words; シンプル was a transliteration sitting between them. +#[test] +fn the_simple_mode_is_named_like_the_others() -> Result<()> { + assert_command_prefix(EXPR, &["ToggleZoomLockUp", "ToggleZoomLockUp"], "簡易 モード") +} + +/// エントリ appeared exactly once in the whole Japanese rule set. This rule +/// speaks 行 and 列 straight after it, and the sibling rule says 表, so セル is +/// the word these rules already use for the thing being read. +#[test] +fn reading_the_current_cell_calls_it_a_cell() -> Result<()> { + assert_command_prefix(TABLE, &["ZoomInAll", "ReadCellCurrent"], "現在のセルを読む") +} + +/// The two states of one toggle. The other is the sentence 移動後に式を読み上げる; +/// this one was the noun phrase 移動後の式の概要, which does not say what will +/// happen to it. +#[test] +fn the_overview_toggle_says_what_it_will_do() -> Result<()> { + assert_command_prefix(EXPR, &["ToggleSpeakMode"], "移動後に式の概要を読み上げる") +}