Translate the Japanese navigation command prefixes - #752
Open
yasumorishima wants to merge 1 commit into
Open
Conversation
`say-command` still set the four prefixes to the English words, so a Japanese synthesiser read them out as English: "move 右", "zoom イン", "read 右", "describe 右". They are now 移動 / ズーム / 読み上げ / 説明. `$CommandOffset` (from ec36e05) already makes this safe: the offset is the length of the English `$NavCommand` stem, not of the spoken prefix, so the suffix test still matches. ja already carried the correct offsets (5/5/5/9). ru, nb, fr, hu and sv translate their prefixes the same way. Word order is the other half. Japanese puts the target before the verb, and the particle belongs to the verb, so a new `$Particle` is set beside the prefix (に for move, を for read and describe) and emitted inside each direction branch: 右 に 移動, 右 を 読み上げ. Keeping the particle inside the branch means a command whose suffix matches nothing still falls back to the bare verb, the way it does in en. The Zoom commands keep the English order: ズーム + イン is the ordinary loanword, and the concatenation that produces ズームインを最大にしました requires the prefix to come first. The two suffix sets are disjoint (Zoom only produces In/InAll/Out/OutAll, the others only Next/Previous/Current/LineStart/ LineEnd), so splitting the branch loses nothing. Two other rules in the same file spoke the same words in the other order and would have contradicted this, so they move too: - `current` (ReadCurrent / DescribeCurrent) said 読み上げ 現在; it now says 現在 を読み上げ. - `move-next-no-auto-zoom-at-edge-math` said 右に for all three verbs, so read and describe got the wrong particle; the direction and particle are now part of each verb branch (右に移動 / 右を読み上げ / 右を説明 できません). audit-translations ja: untranslated text 3577 -> 3574; missing rules 0, extra rules 0. Rule differences 28 -> 30, both in navigate.yaml and both intended: one "variable difference" for the added `$Particle`, one "structure difference" for the reordered branch. Adds tests/Languages/ja/navigate.rs, the first navigation tests for ja. They assert the command prefix with starts_with, because the description that follows comes from NavigationParts and is not what this change touches. Wiring it up needs one line in tests/languages.rs, which is outside Rules/Languages/ja and tests/Languages/ja. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016JCoREgn1pJzcbdnUx4iuh
Contributor
Author
|
The one red check here is not from this PR.
I could not find an existing issue for it (searched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
say-commandstill set the four prefixes to the English words, so a Japanesesynthesiser said them in English: "move 右", "zoom イン", "read 右",
"describe 右". They are now 移動 / ズーム / 読み上げ / 説明, the way ru, nb,
fr, hu and sv already translate theirs.
This is safe because of
$CommandOffset(ec36e05): the offset is the lengthof the English
$NavCommandstem, not of the spoken prefix, so the suffix teststill matches. ja already carried the right offsets (5/5/5/9) — see #740 for
the two languages that do not.
Word order
Japanese puts the target before the verb, and the particle belongs to the
verb, so a
$Particleis now set beside the prefix (に for move, を for readand describe) and emitted inside each direction branch:
MoveNextReadNextZoomInZoomInAllKeeping the particle inside the branch matters: a command whose suffix matches
nothing (
MoveCellUp,MoveStart, …) still falls back to the bare verb, theway it does in en.
The Zoom commands keep the English order on purpose. ズーム + イン is the
ordinary loanword, and the concatenation that produces
ズームインを最大にしました needs the prefix first. The two suffix sets are
disjoint — Zoom only produces In/InAll/Out/OutAll and the others only
Next/Previous/Current/LineStart/LineEnd — so splitting the branch loses
nothing.
Two rules that would have contradicted it
Reviewing the change surfaced two other rules in the same file speaking the
same words in the other order, so they move too:
current(ReadCurrent/DescribeCurrent) never goes throughsay-command; it said 読み上げ 現在 and now says 現在 を読み上げ.move-next-no-auto-zoom-at-edge-mathused 右に for all three verbs, whichgives read and describe the wrong particle. The direction and its particle
are now part of each verb branch: 右に移動 / 右を読み上げ / 右を説明,
followed by できません.
Checks
audit-translations ja: untranslated text 3577 → 3574; missing rules 0,extra rules 0. Rule differences 28 → 30, both of them in
navigate.yamlandboth intended — diffing the audit output against
jashows exactly one"variable difference" (the added
$Particle) and one "structure difference"(the reordered branch).
tests/Languages/ja/navigate.rs, the first navigation tests for ja.They assert the command prefix with
starts_with, because what follows itcomes from
NavigationPartsand is not what this touches.Wiring the new test module in needs one line in
tests/languages.rs, which isthe only change outside
Rules/Languages/jaandtests/Languages/ja.🤖 Generated with Claude Code