i18n-localization by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill i18n-localization国际化(i18n)与本地化(L10n)的最佳实践。
| 术语 | 含义 |
|---|---|
| i18n | 国际化 - 使应用程序可翻译 |
| L10n | 本地化 - 实际的翻译内容 |
| Locale | 语言 + 地区(en-US, tr-TR) |
| RTL | 从右到左书写的语言(阿拉伯语、希伯来语) |
| 项目类型 | 需要 i18n 吗? |
|---|---|
| 公开的 Web 应用 | ✅ 是 |
| SaaS 产品 | ✅ 是 |
| 内部工具 | ⚠️ 可能 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 单区域应用 |
| ⚠️ 考虑未来需求 |
| 个人项目 | ❌ 可选 |
import { useTranslation } from 'react-i18next';
function Welcome() {
const { t } = useTranslation();
return <h1>{t('welcome.title')}</h1>;
}
import { useTranslations } from 'next-intl';
export default function Page() {
const t = useTranslations('Home');
return <h1>{t('title')}</h1>;
}
from gettext import gettext as _
print(_("Welcome to our app"))
locales/
├── en/
│ ├── common.json
│ ├── auth.json
│ └── errors.json
├── tr/
│ ├── common.json
│ ├── auth.json
│ └── errors.json
└── ar/ # RTL
└── ...
| 问题 | 解决方案 |
|---|---|
| 缺少翻译 | 回退到默认语言 |
| 硬编码字符串 | 使用代码检查器/脚本 |
| 日期格式 | 使用 Intl.DateTimeFormat |
| 数字格式 | 使用 Intl.NumberFormat |
| 复数形式 | 使用 ICU 消息格式 |
/* CSS 逻辑属性 */
.container {
margin-inline-start: 1rem; /* 而非 margin-left */
padding-inline-end: 1rem; /* 而非 padding-right */
}
[dir="rtl"] .icon {
transform: scaleX(-1);
}
发布前检查:
| 脚本 | 用途 | 命令 |
|---|---|---|
scripts/i18n_checker.py | 检测硬编码字符串和缺失的翻译 | python scripts/i18n_checker.py <project_path> |
此技能适用于执行概述中描述的工作流程或操作。
每周安装量
1.2K
代码仓库
GitHub 星标数
27.1K
首次出现
Jan 20, 2026
安全审计
安装于
opencode1.0K
gemini-cli1.0K
codex992
github-copilot943
cursor888
amp794
Internationalization (i18n) and Localization (L10n) best practices.
| Term | Meaning |
|---|---|
| i18n | Internationalization - making app translatable |
| L10n | Localization - actual translations |
| Locale | Language + Region (en-US, tr-TR) |
| RTL | Right-to-left languages (Arabic, Hebrew) |
| Project Type | i18n Needed? |
|---|---|
| Public web app | ✅ Yes |
| SaaS product | ✅ Yes |
| Internal tool | ⚠️ Maybe |
| Single-region app | ⚠️ Consider future |
| Personal project | ❌ Optional |
import { useTranslation } from 'react-i18next';
function Welcome() {
const { t } = useTranslation();
return <h1>{t('welcome.title')}</h1>;
}
import { useTranslations } from 'next-intl';
export default function Page() {
const t = useTranslations('Home');
return <h1>{t('title')}</h1>;
}
from gettext import gettext as _
print(_("Welcome to our app"))
locales/
├── en/
│ ├── common.json
│ ├── auth.json
│ └── errors.json
├── tr/
│ ├── common.json
│ ├── auth.json
│ └── errors.json
└── ar/ # RTL
└── ...
| Issue | Solution |
|---|---|
| Missing translation | Fallback to default language |
| Hardcoded strings | Use linter/checker script |
| Date format | Use Intl.DateTimeFormat |
| Number format | Use Intl.NumberFormat |
| Pluralization | Use ICU message format |
/* CSS Logical Properties */
.container {
margin-inline-start: 1rem; /* Not margin-left */
padding-inline-end: 1rem; /* Not padding-right */
}
[dir="rtl"] .icon {
transform: scaleX(-1);
}
Before shipping:
| Script | Purpose | Command |
|---|---|---|
scripts/i18n_checker.py | Detect hardcoded strings & missing translations | python scripts/i18n_checker.py <project_path> |
This skill is applicable to execute the workflow or actions described in the overview.
Weekly Installs
1.2K
Repository
GitHub Stars
27.1K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode1.0K
gemini-cli1.0K
codex992
github-copilot943
cursor888
amp794
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装