agentleFS
pvnarppvnarp/agent-skills/skills/i18n/SKILL.md

i18n

Skill1 starsChanged 9 months agoMITView on GitHub

Guides internationalization (i18n) and localization (l10n) implementation. Covers string extraction, locale handling, date/number/currency formatting, RTL support, and translation workflows. Use when adding multi-language support or reviewing i18n implementation.

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oss-pr, pr-automation and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CES-LtdSkill

    oss-pr

    Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.

    Also in 3 projects that use this

  • CES-LtdSkill

    pr-automation

    PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".

    Also in 3 projects that use this

  • volovelySkill

    pr-fix

    This skill should be used when the user asks to "fix PR comments", "address PR feedback", "resolve PR comments", provides a GitHub PR URL with intent to fix, or says "pr-fix". It reads all review comments on a PR, decides which need code fixes vs. replies, makes the fixes, and posts replies — all with explicit user approval before any GitHub action.

    Also in 3 projects that use this

  • MicrosoftSkill

    bump-version

    Bump the VoxelPic version to a user-specified value. USE FOR: setting or updating the project version across all files that embed it. Applies to requests like 'bump version to X.Y.Z', 'set version', or 'update version'.

    Also in 4 projects that use this

  • Svenja-devSkill

    e2e-testing

    Also in 5 projects that use this

  • k1p1l0Skill

    context

    Transfer context from the current Claude Code terminal session to the Telegram bot session. Use when the user says "send this to telegram", "transfer context", "telegram:context", "teleport to telegram", or wants the Telegram bot to continue work from this session.

    Also in 3 projects that use this

  • +2 more from CES-Ltd

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No hardcoded user-facing strings: Every string the user sees comes from a translation file.

    line 12
  2. Distinctive:

    Keep translations close to where they're used (per-page or per-component bundles for large apps)

    line 49
  3. Distinctive:

    Use ICU MessageFormat or your framework's plural support:

    line 62
  4. Very specific:

    Never format manually: Use Intl (JS), NumberFormat / DateFormat (JVM), or equivalent.

    line 78

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Internationalization (i18n)

i18n is architecture. l10n is content. Get the architecture right first - adding languages later becomes trivial.

Core Principles

  1. No hardcoded user-facing strings. Every string the user sees comes from a translation file.
  2. Locale-aware formatting. Dates, numbers, currency, plurals - never format these yourself.
  3. Design for expansion. German text is ~30% longer than English. UI must accommodate.
  4. Separate translation from code. Translators edit translation files, not source code.

String Externalization

Before (hardcoded)

"3 items in your cart"
"Welcome back, John"
"January 15, 2024"

After (externalized)

t('cart.item_count', { count: 3 })       → "3 items in your cart" / "3 Artikel in Ihrem Warenkorb"
t('greeting.welcome_back', { name })     → "Welcome back, John" / "Willkommen zurück, John"
formatDate(date, { locale })             → "January 15, 2024" / "15. Januar 2024"

Translation File Structure

{
  "cart": {
    "item_count": "{count, plural, one {# item in your cart} other {# items in your cart}}",
    "empty": "Your cart is empty",
    "checkout": "Proceed to checkout"
  },
  "greeting": {
    "welcome_back": "Welcome back, {name}"
  }
}

Rules:

  • Keys are hierarchical and descriptive (cart.item_count, not str_47)
  • Keep translations close to where they're used (per-page or per-component bundles for large apps)
  • English is the source of truth - other locales are translations of it
  • Include context comments for translators when meaning is ambiguous

Pluralization

Different languages have different plural rules. English has 2 forms (1, other). Arabic has 6. Russian has 3. Never do this:

// WRONG
count === 1 ? "1 item" : `${count} items`

Use ICU MessageFormat or your framework's plural support:

"{count, plural, one {# item} other {# items}}"
LanguagePlural FormsExample
Englishone, other1 item, 2 items
Frenchone, other(but 0 is "one")
Russianone, few, many, other1 файл, 2 файла, 5 файлов
Arabiczero, one, two, few, many, other6 forms
Japaneseother(no plural)

Date, Number, and Currency Formatting

Never format manually. Use Intl (JS), NumberFormat / DateFormat (JVM), or equivalent.

// Dates
new Intl.DateTimeFormat('de-DE', { dateStyle: 'long' }).format(date)
// → "15. Januar 2024"

// Numbers
new Intl.NumberFormat('de-DE').format(1234567.89)
// → "1.234.567,89"

// Currency
new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(1000)
// → "¥1,000"

Gotchas:

  • Decimal separator: . (US) vs , (EU) vs ٫ (Arabic)
  • Date order: MM/DD/YYYY (US) vs DD/MM/YYYY (EU) vs YYYY/MM/DD (ISO/Asia)
  • Currency symbol position: $100 (US) vs 100€ (EU) vs 100 ₽ (Russia)
  • Week starts on: Sunday (US) vs Monday (EU/ISO)

RTL (Right-to-Left) Support

Required for Arabic, Hebrew, Persian, Urdu.

CSS

/* Use logical properties instead of physical */
margin-inline-start: 1rem;   /* NOT margin-left */
padding-inline-end: 0.5rem;  /* NOT padding-right */
border-inline-start: 1px solid; /* NOT border-left */
text-align: start;            /* NOT text-align: left */

/* Set direction on the root */
html[dir="rtl"] { direction: rtl; }

Layout

  • Flexbox and Grid with start/end handle RTL automatically
  • Icons with directional meaning (arrows, progress) must be mirrored
  • Phone numbers, code blocks, and URLs stay LTR even in RTL context

Implementation Checklist

Phase 1: Architecture

  • i18n library/framework integrated
  • Locale detection (browser, user preference, URL)
  • Translation file structure defined
  • All user-facing strings externalized (no hardcoded strings)

Phase 2: Formatting

  • Dates use locale-aware formatting
  • Numbers use locale-aware formatting
  • Currency uses locale-aware formatting with correct currency code
  • Pluralization uses ICU/CLDR rules (not if count === 1)

Phase 3: Layout

  • UI handles 30%+ text expansion without breaking
  • CSS uses logical properties (start/end not left/right)
  • RTL layout tested (if supporting RTL languages)
  • Fonts support target language character sets

Phase 4: Workflow

  • Translation file format works with translator tools
  • New strings flagged for translation in code review
  • Missing translations fall back to default language gracefully
  • Translation coverage tracked per locale

Common Mistakes

MistakeProblemFix
Concatenating translated strings"Hello " + name + "!" breaks in other languages (word order differs)Use interpolation: t('hello', { name })
Hardcoded date format"01/02/2024" - is that Jan 2 or Feb 1?Use Intl.DateTimeFormat
Assuming text lengthGerman/Finnish can be 30-50% longerDesign flexible layouts
Translating dev-facing textError codes, log messagesOnly translate user-facing text
Image with embedded textCan't translateUse text overlays or separate images per locale

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.