locale-guard

locale-guard is a skill for Claude Code, Codex from serejaris/kimi-skills. It costs 147 tokens per session (1,655 once invoked), scanned A, original, MIT.

A workflow for adding and checking multiple-language support in frontend applications, including translation files, language switching, and localized metadata.

In plain words
What is it for?
Use it to set up or audit internationalization in React, Next.js, or Vue projects and verify English and Chinese locale coverage.
Why use it?
It finds untranslated text, missing translation keys, inconsistent language files, and formatting problems before they reach users.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to set up or audit internationalization in React, Next.js, or Vue projects and verify English and Chinese locale coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serejaris/kimi-skills/locale-guard
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add serejaris/kimi-skills --skill locale-guard
Clone the repo
git clone --depth 1 https://github.com/serejaris/kimi-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for locale-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/serejaris/kimi-skills/locale-guard/github.svg)](https://agentmods.dev/skills/serejaris/kimi-skills/locale-guard)
Your own site
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/locale-guard"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/locale-guard/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.

agentmods 80×15 button for locale-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/locale-guard"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/locale-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,655 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00147 $0.01655
Opus 5 $0.00073 $0.00827
Sonnet 5 $0.00029 $0.00331
Haiku 4.5 $0.00015 $0.00166

Measured 8d ago against content hash c07d6efe94f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

locale-guard 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/i18n_audit.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/locale-guard/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

国际化本地化助手

概述

完成一次完整的 i18n 搭建 + 审计流程:配置 i18n 框架、将用户可见的字符串替换为翻译键、确保多语言文件一致性、校验 en-US 和 zh-CN 的复数规则与格式化。

核心能力

  • 库选型与配置(React、Next.js、Vue)。
  • 翻译键架构与语言文件组织。
  • 翻译生成策略(AI 翻译、专业翻译、人工翻译)。
  • 路由与语言检测/切换。
  • SEO 和元数据本地化(如适用)。
  • RTL(从右到左)支持(仅在目标语言需要时启用)。

范围输入(不明确时请先确认)

  • 使用的框架和路由方式。
  • 现有的 i18n 状态(无、部分完成、遗留方案)。
  • 目标语言(默认:en-US + zh-CN)。
  • 翻译质量要求(AI 翻译 vs 专业翻译 vs 人工翻译)。
  • 使用的语言文件格式(JSON、YAML、PO、XLIFF)。
  • 语气/文化要求(如有)。

工作流程(审计 -> 修复 -> 验证)

  1. 确认范围和目标语言
  • 识别 i18n 框架和语言文件位置。
  • 确认目标语言;未指定时默认使用 en-US + zh-CN。
  1. 搭建 i18n 基础(如尚未配置)
  • 根据框架选择合适的库(如 React: react-i18next;Next.js: next-intl;Vue: vue-i18n)。
  • 安装依赖包并创建 i18n 入口/配置文件。
  • 在应用根节点挂载 Provider 并加载语言资源。
  • 按需添加语言切换器和持久化机制(路由/参数/localStorage)。
  • 建立语言文件目录结构和命名空间规范。
  • 如果路由需要感知语言,尽早确定语言段策略(子路径、子域名、查询参数)。
  • 如果元数据面向用户,需翻译标题和描述。
  1. 审计翻译键使用情况和多语言一致性
  • 运行:
    python scripts/i18n_audit.py --src <src-root> --locale <path/to/en-US.json> --locale <path/to/zh-CN.json>
    
  • 将缺失的翻译键或一致性问题视为阻塞项。
  • 手动检查动态翻译键(t(var))。
  1. 查找未本地化的硬编码字符串
  • 搜索:
    rg -n --glob '<src>/**/*.{ts,tsx,js,jsx}' "<[^>]+>[^<{]*[A-Za-z][^<{]*<"
    rg -n --glob '<src>/**/*.{ts,tsx,js,jsx}' "aria-label=\"[^\"]+\"|title=\"[^\"]+\"|placeholder=\"[^\"]+\""
    
  • 将无障碍标签也纳入本地化范围。
  1. 用翻译键替换硬编码字符串
  • 使用 t('namespace.key') 替换 UI 文本。
  • 复数场景使用 t('key', { count }) + _one/_other 键。
  • 日期/时间/数字使用 Intl/应用内格式化工具。
  1. 错误信息本地化(关键步骤)
  • 将错误码映射为本地化翻译键;仅向用户展示本地化内容。
  • 原始错误详情仅写入日志。
  • 为未知错误码提供本地化的兜底信息。
  1. 更新语言文件
  • 在所有目标语言文件中补充缺失的键。
  • 保持占位符一致;除非要求否则避免重命名。
  • 按约定的方式生成翻译;保留占位符和复数规则。
  1. 验证
  • 重新运行审计脚本,直到缺失和一致性问题归零。
  • 校验 JSON 格式(如 python -m json.tool <file>)。
  • 更新涉及可见文本的测试用例。

规范约束

  • 绝不向 UI 暴露原始 error.message;只展示本地化字符串。
  • 除非明确要求,不添加额外的语言。
  • 优先使用结构化命名空间(如 errors.*buttons.*workspace.*)。
  • 翻译保持简洁一致。
  • 部分技术/品牌术语保持英文不翻译(如产品名、API、MCP、Bash)。

交付物

  • i18n 配置与 Provider 挂载。
  • 各目标语言的语言文件。
  • UI 字符串已替换为稳定的翻译键。
  • 语言切换器和持久化(如适用)。
  • 更新后的测试用例。

架构指南(简要)

  • 翻译键结构:按功能区域使用嵌套命名空间(如 common.buttons.savepricing.tier.pro)。
  • 文件布局:每种语言一个文件,或按命名空间拆分;确保各语言文件的键保持同步。
  • 占位符:严格保持 {name}/{{name}} 原样;按语言规则校验复数形式。
  • 格式化:使用 Intl/应用内工具处理日期、时间、数字和列表格式化。
  • SEO/元数据:如果应用对外暴露元数据,需翻译标题和描述。
  • RTL:仅在涉及 RTL 语言时处理;使用逻辑 CSS 属性并测试布局。
  • 非 Web 场景(Electron 主进程对话框、CLI 提示、原生菜单)也需要本地化。

Read the full file on GitHub · 129 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 8d ago First seen · 129 lines · 147 tokens per session scan A c07d6efe94f4

Subscribe to this mod's changes

locale-guard is a skill published in the GitHub repository serejaris/kimi-skills (6 stars, last pushed 1mo ago), licensed MIT. It adds 147 tokens to every session and 1,655 once invoked, about $0.0007 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-09-03.

Related

Other skills, from other repositories

adapto-microcopy

Manage UI micro copy (nav, buttons, labels, errors) as Adapto key/value/language entries. Two modes — init seeds a curated, on-brand starter set; extract scans your frontend for hardcoded strings and creates entries + a replacement guide (no source rewrite). Plan-then-apply.

adaptocms/adapto-cms-agent-skills · 69 tokens

performance

Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".

addyosmani/web-quality-skills · 49 tokens

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…

actionbook/actionbook · 118 tokens

core-web-vitals

Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab evidence. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".

addyosmani/web-quality-skills · 67 tokens

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build landing pages, websites, dashboards, web components, or any frontend UI. Generates creative, polished code that avoids generic AI aesthetics.

tobihagemann/turbo · 48 tokens

prototype

Build a self-contained local prototype at .turbo/prototypes/ .html, drive it, and hand it to the user to settle unknowns that prose cannot answer. Use when the user asks to "prototype this", "build a prototype", "mock this up", "show me what it would look like", "let me try the interaction first", or when a decision…

tobihagemann/turbo · 88 tokens