Borrowing it
Nothing to install: this file belongs to iceymoss/go-hichat-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/iceymoss/go-hichat-api/main/.claude/skills/i18n/SKILL.mdgit clone --depth 1 https://github.com/iceymoss/go-hichat-apiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n)<a href="https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n"><img src="https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/i18n/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n"><img src="https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/i18n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium MCP Rug Pull · line 63 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.01272 |
| Opus 5 | $0.00024 | $0.00636 |
| Sonnet 5 | $0.00010 | $0.00254 |
| Haiku 4.5 | $0.00005 | $0.00127 |
Grade A, and why
i18n scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
给 web/ 前端的用户可见文本接入多语言。本项目不用 react-i18next,也没有 web/src/i18n/locales/*.json(CLAUDE.md / frontend.md 里那句已过时,以本文为准)。
机制(真相)
- 字典:
web/src/lib/i18n.ts—— 一个扁平对象dict['zh-CN'] / dict['en'],key 用点号命名(如trend.publish)。 - 取值函数:
t(key, lang),缺失时回退zh-CN,再回退 key 本身。不支持占位符插值。 - Hook:
web/src/hooks/use-i18n.ts的useT(),返回(key) => translate(key, lang),lang 来自useSettingsStore(s => s.language)。 - 占位符:自己用
.replace(),例如t('trend.imageLimit').replace('{count}', String(n))。
步骤
1. 找出硬编码中文
cd web
# 列某组件里所有非注释的中文行
grep -nE "[一-鿿]" src/components/im/Xxx.tsx | grep -vE "^\s*[0-9]+:\s*(//|/\*|\*)"
逐条判断是否用户可见(按钮/标题/placeholder/title/toast/空态/确认弹窗都算)。不该翻译的:语言名本身(简体中文 / English)、代码注释、日志、接口字段名。
2. 在 lib/i18n.ts 加 key
在 zh-CN 块末尾和 en 块末尾各加一组,分组写注释,两边 key 必须一一对应:
// zh-CN 块
'xxx.title': '我的相册',
'xxx.itemCount': '{count} 项',
// en 块
'xxx.title': 'Album',
'xxx.itemCount': '{count} items',
- 命名空间按模块取前缀(
trend.* / fav.* / pe.* / sec.* / upc.*等)。 - 先复用已有 key,文案一致就别新建:通用
common.save/cancel/confirm/back/loadMore、时间group.time.justNow/minutesAgo/hoursAgo/monthDay、在线chat.online/offline。
3. 组件里接 useT
import { useT } from '@/hooks/use-i18n';
export default function Xxx() {
const t = useT(); // 必须在所有 early return 之前(Hooks 规则)
...
<span>{t('xxx.title')}</span>
<input placeholder={t('xxx.search')} />
toast.success(t('xxx.saved'));
<div>{t('xxx.itemCount').replace('{count}', String(n))}</div>
}
每个子组件都要各自 const t = useT() —— 子组件拿不到父组件的 t。
4. 校验
cd web && npx tsc --noEmit -p tsconfig.json 2>&1 | grep <你改的文件名>
# 再确认无残留(排除注释/语言名/兜底)
grep -nE "[一-鿿]" src/components/im/Xxx.tsx | grep -vE "//|/\*|\*|简体中文"
预存的既有报错(如 aspectSquare/ringColor)与本次无关,只看自己文件。
常见坑(务必照做)
- 模块级常量表(
const TYPE_MAP = {1:{label:'文本'}}):函数体外拿不到t。把label:'文本'改成labelKey:'trend.type.text',渲染时t(cfg.labelKey)。 - 模块级辅助函数(
fmtTime/getUserName):加一个t参数fmtTime(date, t),所有调用点传进去。 - 变量名遮蔽:
.map(t => ...)、const t = list.find(...)会把翻译函数t遮蔽。重命名迭代/局部变量(tr/ty),别动翻译函数名。 - early return 之前调 Hook:
useT()不能放在if (!open) return null之后。 - 富文本拆分:
你的数据将<strong>永久删除</strong>这种,拆成t('a')<strong>{t('b')}</strong>t('c')三段 key。 - 批量替换:用
perl -0pi -e "s/.../.../g"(不要加-CSD,否则中文字节与解码不匹配会全部 miss)。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 85 lines · 48 tokens per session scan A 2b469d6e059f
i18n is a skill published in the GitHub repository iceymoss/go-hichat-api (41 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,272 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
harden
Improve interface resilience through better error handling, i18n support, text overflow handling, and edge case management. Makes interfaces robust and production-ready. Use when the user asks to harden, make production-ready, handle edge cases, add error states, or fix overflow and i18n issues.
localization-toolkit
This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages…
json-ui
CRITICAL: Use for json-ui component rendering and development. Triggers on: json-ui, json render, component catalog, report render, HTML report, I18nString, i18n, bilingual, language switch, dual language, PaperHeader, AuthorList, Abstract, MetricsGrid, Section, Highlight, Zod schema, catalog.ts, cli.ts…
experience-ui-bundle-localize
MUST activate to localize / internationalize a uiBundles//src/ project (React or Angular): extract hardcoded user-facing strings into Custom Labels, wire a runtime i18n library over the Platform SDK backend, add labels for another language, or troubleshoot label rendering across locales. Triggers: user-facing string…
extract-source-sample
Given the path to a finished content-goose ad-run folder, extract everything that defines that ad — recipe shot list, VO script, characters, voices, world, atom-skills, master mp4 — and emit a source-sample.json in the exact shape the upload-ad-sample skill writes to the Goose Ads library. Also links every character…
experience-lwc-rtl-validate
Use this skill to review a Lightning Web Component (.html, .js, .css files) for right-to-left (RTL) internationalization correctness, producing a finding list with code-level fixes covering CSS logical properties, bidirectional text handling, keyboard semantics, and RTL-aware SLDS class usage. TRIGGER when the user…