Repository navigation
feat(i18n): add Traditional Chinese (zh-TW) - #481
Merged
Merged
Conversation
Add a third language to the settings picker. Systems reporting zh-TW, zh-HK, zh-MO or zh-Hant now start in Traditional Chinese instead of the Simplified catalog. internal/i18n/traditional.go is generated from the Simplified catalog by tools/zhtw/gen.py, which runs OpenCC and then a glossary of Taiwanese software terms, so upstream strings reach zh-TW by regenerating. Also match Traditional wording in the wording-based prompt checks: the command history filter, the autofill sudo/su presets and one-time code detection. Input at a prompt that does not echo was already never recorded, so the history filter only adds cover for prompts that echo.
Add four words to the zh-TW glossary and regenerate: 背景, 系統匣, 開機時啟動 and 金鑰. The keys page was 金鑰鏈, too close to 鑰匙圈, which is the system keychain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alog Add code_editor.go to the generator's catalogs and map the new strings to Taiwanese terms (尋找, 取代, 產生, 定位字元). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # internal/workbench/workbench.go
Owner
|
Thanks for the contribution! Merged in de87f59, will be released in the next version. |
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.
Closes #478
按 #90 中"按语言逐批引入"的方向,只加入繁体中文一种,不包含 #90 的下拉框和图标。
改动
zh-TW、zh-HK、zh-MO或zh-Hant时,首次启动使用繁体;这些系统此前显示简体(已更新对应测试)。zh-Hans-TW这类明确写了文字的标签仍以文字为准。internal/i18n/traditional.go由tools/zhtw/gen.py从简体目录生成,使用 OpenCC(s2twp)加一份台湾用语术语表。urlZH仍只用于简体界面。cmdhistory、otp、自动填充的 sudo/su 预设)。此前繁体提示不会被这些文字过滤器识别;不回显的输入本来就不会被记录,所以这里补的是会回显的提示。维护成本与体积
python tools/zhtw/gen.py && gofmt -w internal/i18n/traditional.go。译法要改术语表,不要直接改生成的文件。TestEveryLanguageFillsEveryMessage会失败;另有测试检查格式参数一致、目录中没有简体字。637acde测量)。目录是静态数据,没有首次解码。验证
环境:Windows 11,Go 1.27.3,Viva
71a9824,基于b04fcdc。gofmt -l无输出,go vet ./...和go vet -tags dev ./internal/workbench通过。internal/i18n、internal/cmdhistory、internal/otp,以及 workbench 的语言选择、设置、自动填充和主机标签测试。go test ./...有以下失败,相同测试在干净的main(637acde)上同样失败:cmd/motty:TestSecondLaunchHandsOffWithoutOpeningStorage、TestClaimIdentityCanonicalizesDataDirectories、TestClaimIdentityCanonicalizesCaseAliases、TestHeadlessNeedsAnExplicitNonDefaultDataDirectoryinternal/ai/probe:TestProbeModelChatStreamFirstTokeninternal/remotetools:TestGuardedShellChecksBootAndTicksBeforeEveryMutation、TestIdentityProbeDoesNotInterpretProcessCommandAsShell、TestGuardedStatPrefixValidatesStateAndNumericFieldTypesinternal/sessionlog:TestStoreOpensAHomePathContainingSQLiteURICharactersinternal/sshconn:TestPingConnected、TestPingSendsNothingWhileAnEarlierProbeIsUnansweredinternal/workbench:TestLocalProxyCommandsRestorePreviousShellEnvironment、TestLocalProxyCommandsDoNotOverwriteForeignBackup、TestLocalProxyCommandsDoNotOverwriteStrayBackups、TestLocalListShowsApplicationBundlesWithTheirSystemIcontools/releaseprep:TestPrepareBumpsBothVersionFiles、TestPrepareBlocksTestWindowsRemoteProcessScriptOnRealCIM在本分支全量运行时失败两次,单独运行时本分支和main都是 3/3 通过;remotetools不依赖本次改动的包。未验证:
go test -race ./...:本机没有 C 编译器(CGO_ENABLED=0),未运行。截图