Skip to content
Back to skills

I18n Sync

ASecurity

Keeps this project's en/ar translations in sync. Adds a translation key and mirrors it to the other locale, and scans for keys that exist in en but are missing or empty in ar (a silent English fallback) — and orphan ar-only keys. Use when adding translation strings, wiring t()/trans() calls, or when asked to check Arabic translation coverage, find missing translations, or verify locale parity. Web (Vue 3 vue-i18n JSON) and Laravel (PHP lang) both covered.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
ai-agentspythongophpbashvue

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 14, 2026

npx -y skills add AhmedMerza/agent-skills --skill i18n-sync --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of I18n Sync?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for I18n Sync
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ahmedmerza-i18n-sync/badge)](https://www.skillsdirectory.com/skills/ahmedmerza-i18n-sync)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: i18n-sync
description: >-
  Keeps this project's en/ar translations in sync. Adds a translation key and mirrors it to the other locale, and scans for keys that exist in en but are missing or empty in ar (a silent English fallback) — and orphan ar-only keys. Use when adding translation strings, wiring t()/trans() calls, or when asked to check Arabic translation coverage, find missing translations, or verify locale parity. Web (Vue 3 vue-i18n JSON) and Laravel (PHP lang) both covered.
---

<!-- Own skill (local, not tracked by `npx skills`). Built for the app repo's exact
     i18n layout. Encodes real conventions verified against the codebase. -->

# i18n en/ar Sync

The project ships **en + ar only** (`ar` is RTL). A key present in `en` but absent/empty in
`ar` does **not** error — vue-i18n / Laravel silently fall back to English, so Arabic users
see English strings with no warning. This is the same silent-fallback class as the driver
locale bugs. **Never leave a key in one locale but not the other.**

## Where translations live (verified layout)

| Surface | en path | ar path | Format |
|---------|---------|---------|--------|
| **Vue i18n (primary)** | `resources/ts/plugins/i18n/locales/en/<module>.json` | `.../ar/<module>.json` | JSON, **nested** keys, one file per module (~117 modules) |
| Vue i18n (secondary) | `resources/ts/locales/en/*.json` | `resources/ts/locales/ar/*.json` | JSON |
| Laravel (app) | `resources/lang/en/*.php` | `resources/lang/ar/*.php` | PHP arrays |
| Laravel (modules) | `Modules/*/Resources/lang/en/*.php` (also `.../resources/lang` and `.../lang` — casing varies) | `.../ar/...` | PHP arrays |

**Conventions:**
- Vue module filenames are `snake_case` and map to page paths by convention
  (`admin/driverWallets/index` → `driver_wallets`); overrides live in
  `resources/ts/plugins/i18n/index.ts` (`pageModuleOverrides`). When adding keys
  for a page, add them to that page's module file, not `common.json`, unless truly shared.
- Vue keys are **nested** (`payment_links.json` → `pnl` → `heading`); referenced as
  `t('payment_links.pnl.heading')`. Preserve nesting when adding.
- `common.json` and `datatable.json` are eager-loaded (used everywhere); other modules lazy-load.

## Operation A — SCAN for drift (run this to audit coverage)

The bundled scanner deep-flattens nested keys and reports three drift classes:
`missing in ar` (silent English fallback), `empty in ar` (blank render), `orphan in ar` (dead key).

```bash
python3 ~/.codex/skills/i18n-sync/scan_drift.py            # scans the primary Vue locales
python3 ~/.codex/skills/i18n-sync/scan_drift.py <en_dir> <ar_dir>   # any en/ar pair
```

Point it at other surfaces by passing dirs, e.g.:
`python3 .../scan_drift.py resources/ts/locales/en resources/ts/locales/ar`

For Laravel PHP lang, there is no safe generic flattener (arbitrary PHP); diff per file with
`php -r` or read both arrays and compare keys manually.

Report findings grouped by module, most-affected first. Do NOT auto-translate silently —
list what's missing and either (a) add real Arabic if you're confident, or (b) flag for the user.

## Operation B — ADD a key (mirror to both locales)

When adding a new string, write it to **both** `en` and `ar` in the same nested path:

1. Add to `en/<module>.json` with the English text.
2. Add to `ar/<module>.json` with the Arabic translation. If you cannot produce accurate
   Arabic, insert the value as `"⟦AR⟧ <english>"` (a visible marker) and tell the user it needs
   translation — but **still create the key** so the scanner can catch it and it never silently
   falls back mid-render.
3. Keep key ordering/structure consistent with the surrounding file.
4. Wire the call as `t('<module>.<dotted.path>')` (Vue) or `trans('<file>.<key>')` (Laravel).

Never add an en key without its ar counterpart. Never invent a third locale — the app is en/ar only.

## Rules

- **Parity is mandatory**: every add touches both locales; every scan finding is drift to fix.
- **Nested, not flat**: descend into objects; a missing leaf deep in the tree still falls back.
- **Right module file**: page-specific keys go in the page's module, shared ones in `common.json`.
- **Don't machine-translate blindly**: mark uncertain Arabic with `⟦AR⟧` rather than guessing wrong.
- **RTL**: ar is RTL; if a string embeds markup/numbers/units, sanity-check direction.

## Output checklist

- [ ] Every new key exists in BOTH en and ar (nested path identical)
- [ ] Uncertain Arabic marked `⟦AR⟧`, surfaced to the user — never a silent omission
- [ ] Key added to the correct module file (page module vs `common.json`)
- [ ] `t()`/`trans()` call uses the correct dotted path
- [ ] For an audit: drift grouped by module, counts for missing/empty/orphan

Files in this skill

  • SKILL.md4.7 KB
  • scan_drift.py2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.