Communitygithub.com

i18n & 本地化

国际化与本地化工作流技能。当用户需要国际化与本地化模式时使用此技能,包括检测硬编码字符串、管理翻译、区域文件、RTL支持等,操作者应在合并或移交前保留上游工作流、复制的支持文件和来源证明。

i18n & 本地化 是什么?

该技能专为AI智能体(如Claude Code、Cursor、Codex等)的国际化(i18n)与本地化(L10n)工作流而设计,源于上游仓库`antigravity-awesome-skills`中的`i18n-localization`技能,并通过Omni Skills编辑形态打包,同时保留完整的来源追溯。它提供了从核心概念到实现模式的系统化指导,帮助开发者处理翻译键管理、区域文件结构、RTL(从右向左)语言支持、复数规则、日期/数字格式等常见本地化任务。技能包含一个实用的Python检测脚本(`i18n_checker.py`),用于自动发现硬编码字符串和缺失翻译。此外,技能特别强调操作者在使用前必须查阅`metadata.json`和`ORIGIN.md`来确认来源与上下文,避免盲目加载整个上游包。它适用于公共Web应用、SaaS产品等需要多语言支持的场景,并提供了清晰的故障排除指南和相关技能切换建议,确保工作流在操作者、验证器和下游增强流程之间顺畅流转。

兼容平台✓Claude Code✓Codex CLI✓Cursor✓Antigravity✓Gemini CLI✓OpenCode
npx skills add https://github.com/diegosouzapw/awesome-omni-skills/tree/HEAD/skills/i18n-localization-v2

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

i18n & 本地化 是做什么的?

概述

此公共入口副本将 https://github.com/sickn33/antigravity-awesome-skills 中的 plugins/antigravity-awesome-skills/skills/i18n-localization 打包成原生 Omni Skills 编辑形态,同时不隐藏其原始来源。

当操作者需要保持上游工作流、支持文件和仓库上下文完整,同时让公共验证器和私有增强器继续其正常的下游流程时,请使用此技能。

此入口保持复制的上游文件完好无损,并使用 metadata.json 中的 external_source 块以及 ORIGIN.md 作为供审查的来源证明锚点。

i18n & 本地化 > 国际化(i18n)和本地化(L10n)最佳实践。 ---

未能清晰映射到公共标题的导入源部分仍保留在下方或支持文件中。值得注意的导入部分:1. 核心概念,3. 实现模式,4. 文件结构,6. 常见问题,7. RTL 支持,8. 检查清单。

何时使用此技能

将此部分用作触发过滤器。它应在操作者加载文件、运行命令或打开拉取请求之前明确激活边界。

  • 项目类型 - 需要 i18n?
  • 公共 Web 应用 - ✅ 是
  • SaaS 产品 - ✅ 是
  • 内部工具 - ⚠️ 可能
  • 单区域应用 - ⚠️ 考虑未来
  • 个人项目 - ❌ 可选

操作表

情况从何处开始为何重要
首次使用metadata.json在接触复制的工作流之前,通过 external_source 块确认仓库、分支、提交和导入路径
来源审查ORIGIN.md为审查者提供导入源的简明审计线索
工作流执行scripts/i18n_checker.py从对执行产生实质性变化的最小的复制文件开始
支持上下文scripts/i18n_checker.py添加下一个最相关的复制源文件,而无需加载整个包
移交决策## 相关技能当任务偏离时,帮助操作者切换到更强大的原生技能

工作流

此工作流有意同时具备编辑性和操作性。它在满足下游增强流程所依赖的公共入口标准的同时,使导入的来源对操作者保持有用。

  1. 确认用户目标、导入工作流的范围,以及此技能是否仍是当前任务的正确路由器。
  2. 在加载任何复制的上游支持文件之前,先阅读概述和来源证明文件。
  3. 仅加载对当前请求结果产生实质性变化的参考、示例、提示或脚本。
  4. 执行上游工作流,同时在操作笔记中明确保持来源和源边界。
  5. 根据上游期望以及在复制文件中可以指出的证据验证结果。
  6. 当工作移出此导入工作流的核心范围时,升级或移交给相关技能。
  7. 在合并或关闭之前,记录使用了什么、更改了什么以及审查者仍需验证的内容。

导入的工作流笔记

导入:1. 核心概念

术语含义
i18n国际化 - 使应用可翻译
L10n本地化 - 实际翻译
区域设置 (Locale)语言 + 区域(en-US, tr-TR)
RTL从右向左语言(阿拉伯语、希伯来语)

示例

示例 1:直接请求上游工作流

使用 @i18n-localization-v2 来处理 <task>。从复制的上游工作流开始,仅加载改变结果的文件,并在回答中保持来源可见。

说明: 当操作者需要导入的工作流但不需整个仓库时,这是最安全的起点。

示例 2:请求基于来源的审查

根据 metadata.json 和 ORIGIN.md 审查 @i18n-localization-v2,然后解释您会首先加载哪些复制的上游文件以及原因。

说明: 在审查或故障排除之前,当需要精确、可审计的来源解释和文件选择时使用此示例。

示例 3:在执行前缩小复制的支持文件范围

使用 @i18n-localization-v2 处理 <task>。仅加载改变结果的复制的参考、示例或脚本,并明确命名文件后再继续。

说明: 这使技能与渐进式披露保持一致,而不是默认加载整个复制的包。

示例 4:构建审查者包

使用复制的上游文件加上来源审查 @i18n-localization-v2,然后在合并前总结任何差距。

说明: 当拉取请求等待人工审查并且您想要一个可重复的审计包时,此示例很有用。

最佳实践

将生成的公共技能视为上游仓库周围的可审查打包层。目标是保持来源明确,并且仅加载对执行有实质性改进的复制源材料。

  • 使用翻译键,而不是原始文本
  • 按功能命名空间翻译
  • 支持复数形式
  • 处理每个区域设置中的日期/数字格式
  • 从开始就规划 RTL
  • 对复杂字符串使用 ICU 消息格式
  • 在组件中硬编码字符串

导入的操作笔记

导入:5. 最佳实践

应该 ✅

  • 使用翻译键,而不是原始文本
  • 按功能命名空间翻译
  • 支持复数形式
  • 处理每个区域设置中的日期/数字格式
  • 从开始就规划 RTL
  • 对复杂字符串使用 ICU 消息格式

不应该 ❌

  • 在组件中硬编码字符串
  • 连接翻译后的字符串
  • 假设文本长度(德语长 30%)
  • 忘记 RTL 布局
  • 在同一文件中混合语言

故障排除

问题:操作者跳过了导入的上下文并且回答过于通用

症状: 结果忽略了 plugins/antigravity-awesome-skills/skills/i18n-localization 中的上游工作流,没有提及来源,或者根本没有使用任何复制的源文件。 解决方案: 重新打开 metadata.json、ORIGIN.md 和最相关的复制上游文件。首先检查 external_source 块,然后在继续之前重新陈述来源。

问题:导入的工作流在审查期间感觉不完整

症状: 审查者可以看到生成的 SKILL.md,但他们无法快速判断哪些参考、示例或脚本对当前任务重要。 解决方案: 指向证明您所采取路径的精确复制的参考、示例、脚本或资产。如果差距确实存在,请记录在拉取请求中,而不是隐藏它。

问题:任务偏离到不同的专业领域

症状: 导入的技能从正确的位置开始,但工作变成了调试、架构、设计、安全或发布编排,这些由原生技能处理得更好。 解决方案: 使用相关技能部分有意识地移交。保持导入的源可见,以便下一个技能继承正确的上下文,而不是盲目开始。

相关技能

  • @00-andruia-consultant - 当在此导入技能建立上下文之后,工作由该原生专业领域处理得更好时使用。
  • @00-andruia-consultant-v2 - 当在此导入技能建立上下文之后,工作由该原生专业领域处理得更好时使用。
  • @10-andruia-skill-smith - 当在此导入技能建立上下文之后,工作由该原生专业领域处理得更好时使用。
  • @10-andruia-skill-smith-v2 - 当在此导入技能建立上下文之后,工作由该原生专业领域处理得更好时使用。

附加资源

使用下面的支持矩阵和链接文件作为此导入技能的操作者包。它们应反映真实的复制源材料,而非通用脚手架。

资源系列为审查者提供的内容示例路径
references来自上游的复制参考笔记、指南或背景材料references/n/a
examples来自上游的复制工作示例或可重用提示examples/n/a
scripts改变执行或验证的上游辅助脚本scripts/i18n_checker.py
agents真正属于导入包的路由或委派笔记agents/n/a
assets来自源包的复制支持资产或模式assets/n/a

导入的参考笔记

导入:3. 实现模式

React (react-i18next)

import { useTranslation } from 'react-i18next';

function Welcome() {
  const { t } = useTranslation();
  return <h1>{t('welcome.title')}</h1>;
}

Next.js (next-intl)

import { useTranslations } from 'next-intl';

export default function Page() {
  const t = useTranslations('Home');
  return <h1>{t('title')}</h1>;
}

Python (gettext)

from gettext import gettext as _

print(_("Welcome to our app"))

导入:4. 文件结构

locales/
├── en/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
├── tr/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
└── ar/          # RTL
    └── ...

导入:6. 常见问题

问题解决方案
缺少翻译回退到默认语言
硬编码字符串使用 linter/检查器脚本
日期格式使用 Intl.DateTimeFormat
数字格式使用 Intl.NumberFormat
复数形式使用 ICU 消息格式

导入:7. RTL 支持

/* CSS 逻辑属性 */
.container {
  margin-inline-start: 1rem;  /* 而不是 margin-left */
  padding-inline-end: 1rem;   /* 而不是 padding-right */
}

[dir="rtl"] .icon {
  transform: scaleX(-1);
}

导入:8. 检查清单

发布前:

  • 所有面向用户的字符串使用翻译键
  • 所有支持的语言都有区域文件
  • 日期/数字格式化使用 Intl API
  • 已测试 RTL 布局(如果适用)
  • 已配置回退语言
  • 组件中没有硬编码字符串

导入:脚本

脚本目的命令
scripts/i18n_checker.py检测硬编码字符串和缺失翻译python scripts/i18n_checker.py <project_path>

导入:限制

  • 仅当任务明确符合上述描述的范围时,才使用此技能。
  • 不要将输出视为环境特定验证、测试或专家审查的替代方案。
  • 如果缺少所需的输入、权限、安全边界或成功标准,请停止并请求澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

diegosouzapw/awesome-omni-skills

AgentFolio workflow skill. Use this skill when the user needs Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

AgentFolio workflow skill. Use this skill when the user needs Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

AI UGC Ads workflow skill. Use this skill when the user needs When the user wants to create UGC ad campaigns, recruit UGC creators, generate AI UGC content, or scale with user-generated content. Also use when the user mentions 'UGC,' 'user-generated content,' 'creator ads,' 'Spark Ads,' 'whitelisting,' 'AI UGC,' 'Arcads,' 'Creatify,' 'creator brief,' or 'UGC testing.' This skill covers the UGC growth framework from creator recruitment through AI-powered scaling. Do NOT use for technical implementation, code review, or software architecture and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Astro Web Framework workflow skill. Use this skill when the user needs Build content-focused websites with Astro \u2014 zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Copy Editing workflow skill. Use this skill when the user needs You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Copy Editing workflow skill. Use this skill when the user needs You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Copy Editing workflow skill. Use this skill when the user needs You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Fal Image Edit workflow skill. Use this skill when the user needs AI-powered image editing with style transfer and object removal and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Fal Image Edit workflow skill. Use this skill when the user needs AI-powered image editing with style transfer and object removal and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

frontend-design workflow skill. Use this skill when the user needs Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications. Generates creative, polished code that avoids generic AI aesthetics. Do NOT use for design review or audit (use web-design-guidelines or web-quality-audit) and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Frontend Design (Distinctive, Production-Grade) workflow skill. Use this skill when the user needs You are a frontend designer-engineer, not a layout generator and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

i18n & Localization workflow skill. Use this skill when the user needs Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Interactive Portfolio workflow skill. Use this skill when the user needs Expert in building portfolios that actually land jobs and clients - and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Interactive Portfolio workflow skill. Use this skill when the user needs Expert in building portfolios that actually land jobs and clients - and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Landing Page Generator workflow skill. Use this skill when the user needs Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Landing Page Generator workflow skill. Use this skill when the user needs Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Interactive Portfolio workflow skill. Use this skill when the user needs Expert in building portfolios that actually land jobs and clients - and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

Paid Creative AI workflow skill. Use this skill when the user needs When the user wants to create AI-generated ad creative, test performance creative, manage creative fatigue, or optimize paid media with AI tools. Also use when the user mentions 'ad creative,' 'performance creative,' 'creative testing,' 'creative fatigue,' 'Meta ads,' 'Google ads,' 'TikTok ads,' 'AI ads,' 'ad budget,' 'ROAS,' 'Advantage+,' or 'Performance Max.' This skill covers AI-powered paid creative from generation through performance optimization. Do NOT use for technical implementation, code review, or software architecture and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

SEO-AEO Landing Page Writer workflow skill. Use this skill when the user needs Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills

SEO-AEO Landing Page Writer workflow skill. Use this skill when the user needs Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

相关技能