Communitygithub.com

i18n & 本地化

国际化与本地化工作流技能。当用户需要处理国际化与本地化模式时使用该技能,包括检测硬编码字符串、管理翻译、区域设置文件、RTL支持,操作者应在合并或交接前保留上游工作流、复制的支持文件及出处信息。

i18n & 本地化 是什么?

此技能封装自上游仓库 `sickn33/antigravity-awesome-skills` 中的 `plugins/antigravity-awesome-skills-claude/skills/i18n-localization` 目录,以原生 Omni Skills 编辑形态呈现,同时完整保留来源出处。它适用于需要保持上游工作流、支持文件及仓库上下文完整性的场景,同时允许公共验证器和私有增强器继续执行其正常的下游流程。技能通过 `metadata.json` 中的 `external_source` 块及 `ORIGIN.md` 文件作为出处锚点,便于审核。核心内容包括核心概念、实现模式(React、Next.js、Python)、文件结构指导、常见问题解决、RTL支持(CSS逻辑属性)、以及一份可操作的检查清单。工作流强调渐进式信息揭示:先从出处文件入手,仅加载对当前任务有实质性影响的复制文件,执行上游工作流时明确边界,并在合并或关闭前记录使用情况与变更。该技能支持的平台包括 Claude Code、Omni Skills 等,适用于公共 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

在你喜欢的 AI 中提问

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

文档

i18n & 本地化 是做什么的?

概述

此公开副本将 https://github.com/sickn33/antigravity-awesome-skills 中的 plugins/antigravity-awesome-skills-claude/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本地化——实际的翻译
区域设置语言+区域 (en-US, tr-TR)
RTL从右到左的语言(阿拉伯语、希伯来语)

示例

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

使用 @i18n-localization 处理 <任务>。从复制的上游工作流开始,只加载会改变结果的翻译文件,并在回答中保留出处信息。

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

示例 2:请求基于出处的审核

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

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

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

使用 @i18n-localization 处理 <任务>。仅加载会改变结果的已复制参考资料、示例或脚本,并在继续之前明确命名这些文件。

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

示例 4:构建审核包

使用复制的上游文件加上出处信息审核 @i18n-localization,然后在合并前总结任何差距。

说明: 当等待人工审核的拉取请求需要可重复的审计包时,此示例非常有用。

最佳实践

将生成的公开技能视为上游仓库的可审核包装层。目标是保持出处明确,并仅加载对执行有实质性改善的已复制源材料。

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

已导入操作说明

已导入:5. 最佳实践

应该 ✅

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

不应该 ❌

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

故障排除

问题:操作者跳过了已导入的上下文,给出了过于通用的回答

症状: 结果忽略了位于 plugins/antigravity-awesome-skills-claude/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 <项目路径>

已导入:限制

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

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.

相关技能