i18n(hooks/summary): localize hook outcome and force-summary text#446
Merged
Conversation
Two small follow-on batches after #445: 1. hooks.formatHookOutcomeMessage — was hardcoded \`hook \${tag} \\`\${cmd}\\` \${decision}\${truncTag}\`. Pulls the structural words (\"hook\", decision verb, \" (output truncated at 256KB)\") into a new \`hooks.*\` namespace. The technical bits (tag, cmd) stay verbatim — they're identifiers, not prose. 2. loop/force-summary.ts — three user-visible strings: - \"summarizing what was gathered…\" (status during summary call) - the fallback when the model emits hallucinated tool-call markup instead of prose - the error template when the fallback summary itself crashes New \`summary.*\` namespace covers all three. zh-CN translations included. Decision verbs (block / warn / timeout / error) are translated via a small \`hooks.decision\${Capitalize}\` lookup so the formatter still takes \`outcome.decision\` (the typed enum) as input. Test plan: full suite 2301 pass; tsc + biome clean.
3 tasks
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…engine#446) Two small follow-on batches after esengine#445: 1. hooks.formatHookOutcomeMessage — was hardcoded \`hook \${tag} \\`\${cmd}\\` \${decision}\${truncTag}\`. Pulls the structural words (\"hook\", decision verb, \" (output truncated at 256KB)\") into a new \`hooks.*\` namespace. The technical bits (tag, cmd) stay verbatim — they're identifiers, not prose. 2. loop/force-summary.ts — three user-visible strings: - \"summarizing what was gathered…\" (status during summary call) - the fallback when the model emits hallucinated tool-call markup instead of prose - the error template when the fallback summary itself crashes New \`summary.*\` namespace covers all three. zh-CN translations included. Decision verbs (block / warn / timeout / error) are translated via a small \`hooks.decision\${Capitalize}\` lookup so the formatter still takes \`outcome.decision\` (the typed enum) as input. Test plan: full suite 2301 pass; tsc + biome clean.
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.
Why
Two small follow-on batches after #445.
Hook outcomes were hardcoded — `hook ${tag} \
\${cmd}\\${decision}${truncTag}`. A Chinese user with a failing PreToolUse hook saw "hook PreToolUse/Bash `npm test` block (output truncated at 256KB)" with all the structural words still in English.Force-summary path had three user-visible strings: the "summarizing…" status, the hallucinated-markup fallback, and the post-failure error template.
What
`hooks.*` namespace
`tag` and `cmd` are identifiers, kept verbatim. The decision verb is looked up by `outcome.decision` (the typed enum) so the formatter input doesn't change.
`summary.*` namespace
zh-CN translations included for all 10 keys.
Test plan
Follow-ups
Still on the queue: