Communitygithub.com

Desesbraker/agentes-vip

國際化與在地化的模式。偵測硬編碼字串、管理翻譯、語言環境檔案及 RTL 支援。

agentes-vip 是什麼?

這個技能提供了一個全面的指南,用於在軟體專案中實作國際化 (i18n) 與在地化 (L10n) 的最佳實務。它協助開發者偵測並消除元件中的硬編碼字串,建立和管理翻譯檔案,並為從公共網站到 SaaS 產品的各種專案類型處理從左到右 (RTL) 的版面配置。該指南透過使用 React (react-i18next)、Next.js (next-intl) 和 Python (gettext) 等熱門框架的實作範例,涵蓋了核心概念如語言環境、RTL 支援和 ICU 訊息格式。此外,它還包含一個實用的部署前檢查清單和一個偵測遺漏翻譯與硬編碼字串的腳本,讓開發者能夠確保其應用程式具備完善的在地化能力。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Desesbraker/agentes-vip/tree/HEAD/full%20skill/plugins/antigravity-awesome-skills-claude/skills/i18n-localization

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

i18n 與在地化

國際化 (i18n) 與在地化 (L10n) 的最佳實務。


1. 核心概念

術語意義
i18n國際化 - 讓應用程式可翻譯
L10n在地化 - 實際的翻譯
語言環境語言 + 地區 (en-US, tr-TR)
RTL從右到左的語言 (阿拉伯語, 希伯來語)

2. 何時使用 i18n

專案類型需要 i18n?
公開網路應用程式✅ 是
SaaS 產品✅ 是
內部工具⚠️ 或許
單一區域應用程式⚠️ 考慮未來
個人專案❌ 選擇性

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
    └── ...

5. 最佳實務

務必 ✅

  • 使用翻譯鍵,而非原始文字
  • 依功能將翻譯命名空間化
  • 支援複數形式
  • 根據語言環境處理日期/數字格式
  • 從一開始就規劃 RTL
  • 對複雜字串使用 ICU 訊息格式

避免 ❌

  • 在元件中硬編碼字串
  • 串接已翻譯的字串
  • 假設文字長度(德文長 30%)
  • 忘記 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 16 individual skills — each has its own dedicated page.

Desesbraker/agentes-vip

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Desesbraker/agentes-vip

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Desesbraker/agentes-vip

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

Desesbraker/agentes-vip

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Desesbraker/agentes-vip

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

Desesbraker/agentes-vip

Best practices for Remotion - Video creation in React

Desesbraker/agentes-vip

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

Desesbraker/agentes-vip

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

Desesbraker/agentes-vip

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

Desesbraker/agentes-vip

Automate TikTok tasks via Rube MCP (Composio): upload/publish videos, post photos, manage content, and view user profiles/stats. Always search tools first for current schemas.

Desesbraker/agentes-vip

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

Desesbraker/agentes-vip

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

Desesbraker/agentes-vip

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

Desesbraker/agentes-vip

Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks

Desesbraker/agentes-vip

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.

Desesbraker/agentes-vip

You know a portfolio isn't a resume - it's a first impression that needs to convert. You balance creativity with usability. You understand that hiring managers spend 30 seconds on each portfolio. You make those 30 seconds count. You help people stand out without being gimmicky.

相關技能