I18n

From 2017YANR02/cuberoot.me · View interactive version

I18n is an AI agent skill from the GitHub repository 2017YANR02/cuberoot.me. Use for any new or edited user-visible React text, 中英双语、翻译、i18n, locale JSON, language/theme controls, or HeaderToggles. Support only English and Simplified Chinese through tr, T, useT, or locale JSON; never use inline isZh language ternaries.

How to use this skill

Skill file

i18n(core/packages/client,主工作区)

站点只服 en + zh-Hans(简体)。繁体(zh-Hant)2026-06-14 已彻底移除,源码禁写任何繁体字。

四种合法写法(按场景挑)

禁区(以后的 AI 强制遵守)

双层守卫:写入即拦 PreToolUse hook(core/packages/client/scripts/hook-detect-traditional.mjs)+ CI ratchet tests/i18n-no-isz-text-ternary.test.ts(全局语言文案三元计数只降不升;迁移后把 BASELINE 调低)。

唯一允许的 isZh:函数参数(util 契约)

右上角切换器 / 链接

魔方术语(termbase)

WCA 官方专名与网页语料

命名空间

看 i18n/en.json 顶层。复用优先 common.*(loading / back / loadFailed / unknownError / cases)。新 t() 键必须同时进 en.json + zh.json,{{x}} 两边都要有。

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.