Index of every page on this site: llms.txt
All skills
Run it yourself

Audit and fix translation files across locales, with a focus on English and French parity. Use when adding or reviewing translations, when locale files drift out of sync, when a placeholder or plural renders wrong, or whenever the user asks about i18n, l10n, localization, translation keys, or pluralization.

  • 2 files
  • 17 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/catidegla/skillbelt/i18n-parity

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈80 tokens for metadata: the name and description. ≈1.6k when used: this file.

Description uses 4.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈322 characters, or 4.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Translation parity

Translation bugs are quiet. A missing key renders as nav.settings in the interface, a translated placeholder renders as a literal :nom, and neither throws an error in CI. They get found by users.

This skill checks locale files mechanically, then covers the language-specific rules that a key-by-key diff cannot catch.

Run the checker first

skillbelt run i18n-parity

That launches the checker with only what it declared: read access to this project and to the skill's own directory, no write access, no network. It does shell out to php to read PHP locale arrays, which is why it asks for the child process capability, and that grant is not limited to php alone because Node cannot express the narrower one.

If skillbelt is not on the path, node scripts/check-parity.mjs runs the same checker with no limits at all.

It auto-detects the layout. Supported without configuration:

Layout Used by
lang/{locale}/*.php Laravel, needs php on PATH
lang/{locale}.json Laravel JSON translations
messages/{locale}.json next-intl
locales/{locale}/*.json react-i18next, vue-i18n

Options: --source en to change the reference locale, --dir path to point at an unusual layout, --json for machine-readable output.

It exits 1 on anything a user would see: missing keys, empty values, placeholder mismatches. Untranslated values and extra keys warn but do not block, because sometimes a string genuinely is identical in both languages.

Wire it into CI. Drift is easier to prevent than to repair.

What the checker finds

  • Missing keys. Present in the source locale, absent in the target.
  • Empty values. A key that exists with an empty string, which is worse than missing because fallback logic often skips it.
  • Placeholder mismatch. The most damaging class. See below.
  • Plural branch mismatch. Source has two branches, target has one.
  • Possibly untranslated. Identical multi-word values.
  • Extra keys. In the target and not the source, usually left over from a removed feature.

Placeholders must not be translated

This is the single most common French localization bug, because the placeholder name looks like a word.

// en
'welcome' => 'Hello :name, you have :count messages',

// Wrong: the placeholder was translated along with the sentence.
'welcome' => 'Bonjour :nom, vous avez :count messages',

:nom never gets substituted. The user sees the literal text :nom. The checker catches this by comparing the placeholder sets on both sides.

Same rule for ICU and next-intl: {name} stays {name}, only the surrounding text changes.

Pluralization

English and French do not agree on zero. English treats 0 as plural, French treats it as singular.

Count English French
0 0 items 0 article
1 1 item 1 article
2 2 items 2 articles

Laravel's MessageSelector already implements the French rule, so trans_choice picks the right branch as long as you use it. The bug appears when someone builds the string by hand:

// Wrong: applies the English rule to French.
$label = $count === 1 ? 'article' : 'articles';

// Right.
trans_choice('messages.articles', $count);
// lang/fr/messages.php
'articles' => 'article|articles',

For explicit ranges, Laravel accepts:

'inbox' => '{0} Aucun message|{1} Un message|[2,*] :count messages',

In ICU, which next-intl and formatjs use, French needs its own categories. Do not assume one and other map across languages the same way:

{count, plural, =0 {Aucun article} one {# article} other {# articles}}

Languages with more than two forms (Arabic has six, Russian and Polish have three) will silently fall back to other if the categories are missing. If the project targets any of those, check the CLDR categories rather than copying the English structure.

French typography

Reviewers miss these and native speakers notice immediately.

  • Narrow non-breaking space before ; : ! ? and inside « ». Bonjour ! not Bonjour!. The character is U+202F, or U+00A0 as the widely supported fallback. A regular space lets the punctuation wrap to the next line on its own.
  • Guillemets for quotations, « comme ceci », not "like this".
  • Decimal comma and space thousands separator. 1 234,56 not 1,234.56. Use Intl.NumberFormat('fr-FR') or PHP's NumberFormatter, never string manipulation.
  • Lowercase months and weekdays. 7 septembre 2026, not 7 Septembre 2026.
  • Currency after the amount. 12,50 € not €12.50.
  • Capitalization in titles is sentence case, not title case. Paramètres du compte, not Paramètres Du Compte.

Hardcoded strings

Keys that exist in both locales are only half the job. Strings never extracted at all are the other half.

# Laravel Blade
rg -n --glob '*.blade.php' '>[A-Z][a-z]+ [a-z ]{4,}<'

# React and Next.js JSX text nodes
rg -n --glob '*.tsx' '>\s*[A-Z][a-z]+ [a-z][a-z ]{4,}\s*<'

# User-facing strings in validation and exceptions
rg -n --type php "(abort|throw new \w+Exception)\(\s*\d*,?\s*['\"][A-Z]"

Expect false positives from component names and code identifiers. Skim, do not automate the fix.

Also check the places translations get forgotten by convention: validation messages, mail subjects and bodies, notification titles, PDF and export headers, aria-label and alt attributes, error pages, and enum labels rendered in the interface.

Adding a locale

  1. Copy the source locale files, keeping every key.
  2. Translate values only. Never touch keys or placeholders.
  3. Register the locale in the framework config. Laravel: config/app.php plus the locale middleware. next-intl: the routing config and middleware matcher.
  4. Set the lang attribute on the html element. Screen readers and browser translation both depend on it.
  5. Run the checker.
  6. Check date, number and currency formatting actually switched, not just the strings.

Reviewing a translation pull request

  • Run the checker and paste the output.
  • Confirm no key or placeholder changed. git diff should show changes on the right side of => only.
  • Spot-check the longest strings, where meaning drifts most.
  • Check the French typography rules above.
  • Confirm anything user-visible added in the same PR was extracted rather than hardcoded.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at aec9f08. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago
entry
scripts/check-parity.mjs
allow-read
project, skill
allow-write
none
Other metadata
allow-net
no
allow-exec
php

README badge

README badge for catidegla/skillbelt/i18n-parity