Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

software-localisation软件本地化

Agent Skill

software-localisation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,423

周安装

103

GitHub Stars

60

下载量

849
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:software-localisation(软件本地化)
来源仓库:https://github.com/vasilyu1983/ai-agents-public
仓库路径:skills/software-localisation
安装命令:
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill software-localisation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill software-localisation

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于根据关键词或任务场景从多个来源中筛选出相关技术方案或工具。
  • 通过关键词匹配和来源仓库分析实现信息聚合与初步评估。
  • 安装命令:npx skills add https://github.com/vasilyu1983/ai-agents-public --skill software-localisation
  • 建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。

SKILL.md

Software Localisation - Quick Reference

Production patterns for internationalisation (i18n) and localisation (l10n) in modern web applications. Covers library selection, translation management, ICU message format, RTL support, and CI/CD workflows.

Snapshot (2026-02): i18next 25.x, react-i18next 16.x, react-intl 8.x, vue-i18n 11.x, next-intl 4.x, @angular/localize 21.x. Always verify current versions in the target repo (see Currency Check Protocol).

Authoritative References:

Quick Reference

TaskTool/LibraryCommandWhen to Use
React i18nreact-i18nextnpm i i18next react-i18nextMost React apps, flexibility
React i18n (ICU)react-intl (FormatJS)npm i react-intlICU-first message catalog + tooling
Vue i18nvue-i18nnpm i vue-i18nVue 3 apps
Angular i18n@angular/localizeng add @angular/localizeAngular apps
Next.js i18nnext-intlnpm i next-intlNext.js App Router
Minimal bundleLinguiJSnpm i @lingui/core @lingui/reactBundle size critical
Type-safetypesafe-i18nnpm i typesafe-i18nTypeScript-first projects
String extractioni18next-parsernpx i18next-parserExtract keys from code
ICU linting@formatjs/clinpx formatjs extractValidate ICU messages

Decision Tree: Library Selection

Project requirements:
    │
    ├─ React/Next.js project?
    │   ├─ ICU-first message catalogs + FormatJS tooling?
    │   │   └─ react-intl (FormatJS)
    │   │
    │   ├─ Flexibility, plugins, lazy loading?
    │   │   └─ react-i18next
    │   │
    │   ├─ Bundle size critical?
    │   │   └─ LinguiJS (ICU syntax)
    │   │
    │   └─ TypeScript-first, compile-time safety?
    │       └─ typesafe-i18n
    │
    ├─ Vue/Nuxt project?
    │   └─ vue-i18n (Composition API)
    │
    ├─ Angular project?
    │   ├─ Built-in solution preferred?
    │   │   └─ @angular/localize (first-party, AOT support)
    │   │
    │   └─ Need i18next ecosystem?
    │       └─ angular-i18next (wrapper)
    │
    └─ Framework-agnostic / Node.js?
        └─ i18next core (works everywhere)

Library Comparison

LibraryICU SupportLazy LoadingTypeScriptBest For
react-i18nextPlugin/optionalNativeGoodFlexible, popular React choice
react-intlNativeManualGoodICU-first catalogs + tooling
LinguiJSNativeNativeExcellentBundle-conscious apps
typesafe-i18nLimitedManualExcellentCompile-time key safety
vue-i18nNativeNativeGoodVue 3 apps
@angular/localizeNativeAOTNativeAngular apps

Core Concepts

Character Encoding (Critical)

Always use UTF-8 across your entire stack to prevent text corruption:

PASS Required: UTF-8 everywhere
- Database: utf8mb4 (MySQL) or UTF-8 (PostgreSQL)
- HTML: <meta charset="UTF-8">
- HTTP headers: Content-Type: text/html; charset=utf-8
- File encoding: Save all source files as UTF-8
- API responses: JSON with UTF-8 encoding

UTF-8 supports all Unicode characters including emojis, mathematical symbols, and all language scripts. Inconsistent encoding causes: corrupted characters (�), failed searches for accented names, and rejected international input.

Translation Key Patterns

// Flat keys (simple)
"welcome": "Welcome to our app"
"user.greeting": "Hello, {name}"

// Nested keys (organised)
{
  "user": {
    "greeting": "Hello, {name}",
    "profile": {
      "title": "Your Profile"
    }
  }
}

// Namespace separation (scalable)
// common.json, auth.json, dashboard.json

ICU Message Format Essentials

// Simple interpolation
"Hello, {name}!"

// Pluralisation
"{count, plural, one {# item} other {# items}}"

// Select (gender, category)
"{gender, select, male {He} female {She} other {They}} liked your post"

// Number formatting
"Price: {price, number, currency}"

// Date formatting
"Posted: {date, date, medium}"

Locale Detection Strategy

Priority order:
1. User preference (stored in profile/localStorage)
2. URL parameter or path (/en/about, ?lang=de)
3. Cookie (NEXT_LOCALE, i18next)
4. Accept-Language header
5. Default locale fallback

Locale Quality Gates (SEO/AEO-Safe)

Use these gates for locale-routed, indexable pages (for example /vi/*, /de/*):

  • Do not ship mixed-language content on a single locale route.
  • Do not silently fall back to English for indexable page content.
  • Keep metadata, breadcrumbs, and JSON-LD in the same locale as visible content.
  • Prefer explicit missing-key handling in CI over runtime fallback in production SEO pages.
  • If fallback is unavoidable, use locale-safe neutral copy and track missing keys.

Missing Translation Decision Rule

  • Marketing/SEO pages: block publish or replace with locale-safe copy; never inject English fragments.
  • Product UI (non-indexed surfaces): fallback is acceptable with telemetry and follow-up fix.

EN/RU Mixed-Language Regression Protocol

Use this when users report locale mixing (for example RU screens showing EN fragments).

1) Key-Parity Diff (Base vs Target Locale)

Compare key sets between source and target locale files; treat missing keys as release blockers on user-facing pages.

jq -r 'paths(scalars) | join(".")' app/src/messages/en/*.json | sort -u > /tmp/en.keys
jq -r 'paths(scalars) | join(".")' app/src/messages/ru/*.json | sort -u > /tmp/ru.keys
comm -23 /tmp/en.keys /tmp/ru.keys   # present in EN, missing in RU

2) Hardcoded-String Sweep in UI

Search for user-visible literals in components/pages that should use i18n keys.

rg -n '>[A-Za-z][^<]{2,}<' app/src -g '*.tsx'
rg -n '"[A-Za-z][^"]{2,}"' app/src -g '*.tsx' -g '*.ts'

3) Route-Level Locale Smoke Check

For target locale routes, verify rendered text is consistently localized and no fallback EN fragments appear in critical UI regions.

4) Engine Text Audit

Ensure computed/engine-driven messages (not just static labels) pass through translation mapping instead of returning raw EN strings.

5) CI Gate

Add a lightweight gate that fails when:

  • required target-locale keys are missing,
  • newly added UI literals bypass the i18n layer,
  • locale-routed smoke pages include mixed-language sentinel terms.

Runtime Constraint Note

If an agent runtime has no external translation connector, do not block on auto-translation tools. Enforce key completeness + placeholder strategy, then backfill approved translations in a separate tracked pass.

Engine Output i18n (_i18n Metadata Pattern)

Server-generated engine content (astrology calculations, ML outputs, computed reports) needs localisation without making the engine locale-aware.

Pattern

  • Engine attaches _i18n: {key: "transits.neptune_trine.description", params: {planet: "Neptune"}} alongside the English string
  • Client resolves: _i18n? t(_i18n.key, _i18n.params): englishFallback
  • Backward-compatible: old cached responses without _i18n gracefully degrade to English
  • Server caches once; every locale resolves on the client
  • Use t.has(key) before t(key) for graceful fallback
PatternStatusWhy
{text: "Neptune trine Jupiter", _i18n: {key: "transits.neptune_trine", params: {p1: "Neptune", p2: "Jupiter"}}}PASSClient resolves per locale; server caches once
{text_en: "...", text_ru: "...", text_de: "..."}FAILServer bloat, cache per locale
t(meaning.theme)FAILUsing raw engine output as translation key
t.has('meanings.4.theme')? t('meanings.4.theme'): meaning.themePASSGraceful fallback when key missing

Locale Key Design Anti-Patterns

"1 Field, N Slots"

Using one locale key for multiple distinct UI purposes. Each UI slot (badge, card title, modal description, affirmation) needs its own semantically distinct key, even if the English text happens to be similar.

PatternStatusWhy
meanings.4.advice used for karmic debt, life path, birthday guidance, and advanced cycles (same text 6x)FAILCoupling breaks when any slot needs a different translation
meanings.4.advice, karmicDebt.4.lifeLesson, lifePath.4.affirmation, birthday.4.guidancePASSDistinct keys per slot — independent translation

Short vs. Long Variants

Plan for both from the start.

PatternStatusWhy
nodeGrowth (full: "North Node — growth and new beginnings") + nodeGrowthShort (badge: "Growth")PASSEach UI context gets appropriate length
Single nodeGrowth key that's too long for badge UI, requires substring hacksFAILSubstring breaks in non-English locales

Static Key Maps over String Transforms

When API output format doesn't match locale key naming, use a hardcoded map instead of string manipulation.

// PASS: Explicit map — handles all edge cases
const PHASE_TO_KEY: Record<string, string> = {
  "New Moon": "new", "Waxing Crescent": "waxingCrescent",
  "First Quarter": "firstQuarter", "Full Moon": "full"
};

// FAIL: String transform — breaks on "New Moon" → "newMoon" vs actual key "new"
const key = phaseName.replace(/\s+/g, '').replace(/^./, c => c.toLowerCase());

Machine Translation Quality Gates

Short, domain-specific terms trip up automated MT. Known examples:

LocaleExpectedMT OutputTerm
Arabicأرض (earth as element)أذن (ear)"earth"
Japanese (fire as element) (fir tree)"fire"
Hindiभू (earth)कान (ear)"earth"

Rules

  1. Maintain a curated dictionary of domain terms (zodiac signs, elements, planetary names, astronomical terms) per locale
  2. Never auto-translate terms shorter than 3 words without dictionary lookup
  3. Post-MT audit: grep for known bad translations (compile a blocklist per locale)
  4. For new locales, translate domain terms first, then use them as glossary constraints for MT

Locale Propagation Protocol

Every commit adding EN keys MUST propagate to all target locales. This is the #1 recurring i18n bug — hit in 4+ independent sessions.

Steps

  1. Before commit: diff EN locale files against target locales for missing keys
  2. Script-based propagation: inject missing keys from EN into all other locales with EN fallback values
  3. CI gate: fail builds when target locale files have fewer keys than EN (configurable threshold)
  4. Pre-commit hook (optional): auto-run propagation script on staged locale files

Quick Key-Parity Check

jq -r 'paths(scalars) | join(".")' messages/en/*.json | sort -u > /tmp/en.keys
for locale in ar de es fr hi it ja ko pt-BR ru tr vi zh; do
  jq -r 'paths(scalars) | join(".")' messages/$locale/*.json | sort -u > /tmp/$locale.keys
  echo "=== $locale missing ==="
  comm -23 /tmp/en.keys /tmp/$locale.keys | head -20
done

Batch Translation Approach

Find all gaps first (diff-based), then translate systematically file-by-file. One-at-a-time discovery is 5x slower than batching:

  1. Run key-parity check across all locales to produce the full gap list
  2. Group missing keys by namespace/file
  3. Translate one file at a time for each locale, using existing translations as glossary context
  4. Verify parity after the batch completes

Duplicate JSON Key Detection

Large hand-edited JSON locale files can have duplicate keys. Per JSON spec, last-writer-wins — keys are silently dropped.

CI Check

# Detect duplicate keys in JSON locale files
node -e "
const fs = require('fs');
const file = process.argv[1];
const text = fs.readFileSync(file, 'utf8');
const keys = [];
JSON.parse(text, (key, value) => { if (key) keys.push(key); return value; });
const dupes = keys.filter((k, i) => keys.indexOf(k) !== i);
if (dupes.length) { console.error('DUPLICATE KEYS in', file, ':', [...new Set(dupes)]); process.exit(1); }
" "$FILE"

Run this on every locale file in CI to catch silent key collisions before they reach production.

Navigation

Resources (Deep Dives)

Templates (Production Starters)

Data

Related Skills

Common Patterns

Namespace Organisation

locales/
├── en/
│   ├── common.json      # Shared: buttons, errors, nav
│   ├── auth.json        # Login, register, password
│   ├── dashboard.json   # Dashboard-specific
│   └── validation.json  # Form validation messages
├── de/
│   └── ... (same structure)
└── ar/
    └── ... (same structure)

Lazy Loading and TypeScript Integration

Load namespaces on demand (i18n.loadNamespaces) and use CustomTypeOptions in i18next to get compile-time key safety. See references/framework-guides.md for per-framework setup with code examples.

Anti-Patterns to Avoid

Anti-PatternProblemFix
Hardcoded stringsNot translatableExtract all user-facing text
String concatenationBreaks translation contextUse interpolation {name}
Manual pluralisationWrong for many languagesUse ICU plural rules
Inline styles for RTLDoesn't scaleUse CSS logical properties
Storing locale in URL onlyLost on navigationAlso persist to cookie/storage
No fallback localeBlank text for missing keysAlways set fallbackLng
Silent English fallback on indexable non-English pagesMixed-language output harms UX and can weaken locale SEO/AEO qualityUse locale-safe copy or fail build on missing keys for indexable routes
Loading all locales upfrontSlow initial loadLazy load per namespace/locale

Operational Checklist

Initial Setup

  • REQUIRED: Choose i18n library based on decision tree
  • REQUIRED: Set up directory structure for translations
  • REQUIRED: Configure fallback locale chain
  • REQUIRED: Set up locale detection strategy
  • REQUIRED: Add TypeScript types for translation keys
  • REQUIRED: Configure lazy loading for namespaces

Translation Workflow

  • REQUIRED: Set up string extraction (i18next-parser, formatjs, Lingui)
  • REQUIRED: Integrate with a TMS when needed (Phrase, Lokalise, Crowdin, Locize)
  • REQUIRED: Configure CI/CD for translation sync
  • REQUIRED: Set up translation review process (glossary + style guide + QA gates)
  • REQUIRED: Add missing key detection in development
  • REQUIRED: Add hardcoded string detection for locale-routed pages
  • REQUIRED: Verify metadata + JSON-LD locale parity with visible content
  • REQUIRED: Add locale QA for mixed-language regressions on high-intent pages

i18n Key Validation (Per-Change Gate)

When adding new t() / useTranslations() calls or new message keys:

  1. Verify the key exists in the base locale file (e.g., messages/en/*.json).
  2. Add the key to the base locale file before using it in code.
  3. For multi-locale projects, add placeholder entries in all locale files or confirm the fallback chain handles missing keys gracefully.
  4. Run the project's missing-key detection (e.g., npm run build or next-intl compile check) before committing.

Missing i18n keys cause blank text or fallback-language bleed on localized pages — a silent, user-facing regression.

RTL Support

  • REQUIRED: Use CSS logical properties (margin-inline-start)
  • REQUIRED: Set dir="rtl" for RTL locales
  • REQUIRED: Test with real RTL content (Arabic, Hebrew)
  • REQUIRED: Handle bidirectional text (BiDi) in mixed strings
  • REQUIRED: Mirror directional icons and images where appropriate

Testing

  • REQUIRED: Test pluralisation with 0, 1, 2, 5, 21 (language-specific)
  • REQUIRED: Test date/number/currency formatting per locale
  • REQUIRED: Test RTL layout in key screens/components
  • REQUIRED: Test missing translation key handling (dev-only warnings)
  • REQUIRED: Test locale switching and persistence (cookie/storage/url)

Currency Check Protocol

When recommending libraries, versions, or tooling, verify what is current for the target ecosystem and project constraints. Prefer package registries and release notes over stale hard-coded numbers.

Package versions (Node/npm)

npm view i18next version
npm view react-i18next version
npm view react-intl version
npm view vue-i18n version
npm view next-intl version
npm view @angular/localize version
npm view @lingui/core version
npm view typesafe-i18n version

"Is X still recommended?" checks

  • Check the project's last release date, open issues, and maintenance activity (GitHub releases/issues).
  • Check framework compatibility (Next.js App Router/RSC, React 19, Vue 3, Angular current major).
  • For bundle concerns, measure in the real app with a bundle analyzer instead of relying on published size claims.

Ops Runbook: Large Locale Catalogs (LLM-Safe)

Use this when locale catalogs are too large for single reads, mixed-language UI appears, or missing keys are reported. See references/ops-runbook.md for triage scripts, key-parity checks, hardcoded string sweeps, and CI gate patterns.

Operational Rules:

  • Never read large locale files in one shot; always chunk.
  • Use key diff first, translation pass second.
  • Treat marketing/SEO locale key gaps as release blockers.
  • Do not auto-insert machine translations without a tracked review pass.

Fact-Checking

  • Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
  • Prefer primary sources; report source links and dates for volatile information.
  • If web access is unavailable, state the limitation and mark guidance as unverified.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

31.24%
按下载量换算265

Cursor

24.64%
按下载量换算209

Gemini CLI

16.63%
按下载量换算141

Antigravity

12.15%
按下载量换算103

Codex

8.92%
按下载量换算76

trae

3.43%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills