Communitygithub.com

ComeOnOliver/skillshub

提取硬編碼字串以進行 i18n,管理翻譯檔案,並確保語言環境覆蓋率。適用於多語言應用程式、翻譯或使用者提及 i18n、本地化或語言相關需求時使用。

skillshub 是什麼?

這是一個專門用於管理應用程式國際化 (i18n) 與本地化 (l10n) 的 AI 技能,特別適合 React、Vue、Python 與 Ruby/Rails 等支援多語言架構的專案。它能自動偵測專案中使用的 i18n 框架(如 react-i18next、vue-i18n、gettext、Django i18n 或 Rails I18n gem),並協助開發者找出 JSX、模板、表單標籤或按鈕中未翻譯的硬編碼字串,將其萃取成結構化的翻譯金鑰。此外,技能還會比較不同語言檔案(如 en.json 與 es.json)的覆蓋率,列出缺失的翻譯,並提供複數化、日期/數字格式化、RTL 支援等最佳實踐建議。透過遵循命名空間與上下文描述等規則,它能確保翻譯檔案易於維護,並為翻譯人員提供清晰的金鑰上下文。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/internationalization-helper

在你喜歡的 AI 中提問

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

說明文件

國際化輔助工具

協助管理多語言應用程式中的國際化 (i18n) 與本地化 (l10n)。

使用時機

  • 使用者要求 i18n 支援
  • 新增語言
  • 尋找未翻譯的字串
  • 管理翻譯檔案
  • 使用者提及「翻譯」、「i18n」、「l10n」、「語言環境」

指示

1. 偵測 i18n 框架

JavaScript/React:

  • react-i18next
  • react-intl (FormatJS)
  • i18next
  • LinguiJS

Vue:

  • vue-i18n

Python:

  • gettext
  • Django i18n
  • Flask-Babel

Ruby/Rails:

  • I18n gem(內建)

尋找 imports、設定檔或翻譯目錄。

2. 尋找硬編碼字串

搜尋未翻譯的文字:

// 錯誤:硬編碼
<button>Submit</button>
<p>Welcome, {user.name}!</p>

// 正確:已翻譯
<button>{t('common.submit')}</button>
<p>{t('welcome.message', { name: user.name })}</p>

搜尋模式:

  • JSX/模板標籤中的字串
  • 提示/錯誤訊息
  • 表單標籤與佔位符
  • 按鈕文字
  • 驗證訊息

排除:程式碼註解、console.log、測試字串

3. 萃取至翻譯檔案

React-i18next 格式 (JSON):

{
  "common": {
    "submit": "Submit",
    "cancel": "Cancel"
  },
  "welcome": {
    "message": "Welcome, {{name}}!"
  }
}

Gettext 格式 (.po):

msgid "submit_button"
msgstr "Submit"

msgid "welcome_message"
msgstr "Welcome, %(name)s!"

4. 組織翻譯金鑰

最佳實踐:

  • 按功能命名空間:users.profile.title
  • 分組通用字串:common.buttons.save
  • 描述上下文而非內容:errors.login.invalid 而非 errors.wrong_password
  • 一致的命名慣例

5. 檢查翻譯覆蓋率

比較語言環境檔案以找出遺漏的翻譯:

en.json: 150 個金鑰
es.json: 142 個金鑰(缺少 8 個)
fr.json: 150 個金鑰 ✓

es.json 缺少:
- users.profile.bio
- settings.privacy.title
[...]

6. 處理複數化

不同語言有不同複數規則:

// react-i18next
t('items', { count: 0 })  // "0 items"
t('items', { count: 1 })  // "1 item"
t('items', { count: 5 })  // "5 items"

// 翻譯檔案
{
  "items_zero": "{{count}} items",
  "items_one": "{{count}} item",
  "items_other": "{{count}} items"
}

7. 日期、時間、數字格式化

使用語言環境感知的格式化:

// 數字
const price = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD'
}).format(29.99);

// 日期
const date = new Intl.DateTimeFormat('fr-FR').format(new Date());

8. RTL(從右到左)支援

針對阿拉伯語、希伯來語:

  • CSS:direction: rtl;
  • HTML:<html dir="rtl">
  • 邏輯屬性:使用 margin-inline-start 取代 margin-left

9. 產生翻譯模板

為新語言環境建立模板:

# 從基礎語言複製金鑰,清空值
cp locales/en.json locales/de.json
# 標記為待翻譯

10. 最佳實踐

  • 將翻譯放在獨立檔案中
  • 使用金鑰,而非原始文字作為金鑰
  • 為翻譯人員提供上下文
  • 測試長字串(德語通常較長)
  • 對於複雜字串使用 ICU MessageFormat
  • 避免串接已翻譯的字串
  • 萃取所有面向使用者的文字

支援檔案

  • templates/i18n-config.js:設定範例
  • templates/locale-file.json:翻譯檔案模板

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

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

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能