agentleFS
muon-m2muon-m2/magento2-tools/skills/i18n/SKILL.md

i18n

Skill4 starsChanged 57 days agoMITView on GitHub

Translation extraction + merge for a module. - Never overwrite existing translations. Sync adds new phrases, preserves existing values. Removed phrases move to a commented "obsolete" section, NOT deleted. - Placeholder consistency. %1, %2 count in source must match each target locale. Mismatches surface as findings. - CSV validity always. Output CSVs are UTF-8 and parseable by Magento's translation loader. - Magento CLI preferred. Use bin/magento i18n:collect-phrases when available; regex fallback otherwise. Invoke context. Capture Magento CLI availability. If Magento…

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 8 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

  • conorluddySkill

    state-management

    Cache management, configuration best practices, and progressive disclosure patterns for efficient context window usage. Use when working with large responses, optimizing token costs, or managing plugin state across operations.

    Also in 4 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

  • +2 more from CES-Ltd

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Magento CLI preferred: Use bin/magento i18n:collect-phrases when available.

    line 23
  2. Distinctive:

    If Magento CLI available:

    line 45
  3. Very specific:

    Run ${CLAUDE_SKILL_DIR}/scripts/merge-csv.sh <fresh.csv> <locale.csv> for each target locale.

    line 61

“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

Magento 2 i18n

Translation extraction + merge for a module.

Core Rules

  • Never overwrite existing translations. Sync adds new phrases, preserves existing values. Removed phrases move to a commented "obsolete" section, NOT deleted.
  • Placeholder consistency. %1, %2 count in source must match each target locale. Mismatches surface as findings.
  • CSV validity always. Output CSVs are UTF-8 and parseable by Magento's translation loader.
  • Magento CLI preferred. Use bin/magento i18n:collect-phrases when available; regex fallback otherwise.

Workflow

Phase 0 — Context Resolution

Invoke context. Capture Magento CLI availability.

Phase 1 — Scope

Ask:

  • Modules to extract from (default: all custom modules under {vendor_lower}/).
  • Target locale(s) (default: en_US + all existing locale CSVs).
  • Behaviour for missing translations:
    • Leave empty (default)
    • Copy English string
    • Machine-translate (requires API key in env)

Phase 2 — Extract

If Magento CLI available:

{ctx.magento_cli} i18n:collect-phrases {ctx.magento_root}/app/code/{Vendor}/{Module}/ -o /tmp/extract.csv

Otherwise: regex scan via ${CLAUDE_SKILL_DIR}/scripts/extract.sh for:

  • __('text') and __("text") in PHP
  • <label translate="true">text</label> in XML
  • <item name="..." translate="true">text</item> in XML
  • $t('text') in JS
  • data-bind="i18n: 'text'" in HTML

Phase 3 — Merge

Run ${CLAUDE_SKILL_DIR}/scripts/merge-csv.sh <fresh.csv> <locale.csv> for each target locale. The script guarantees:

  • Existing translations are preserved byte-for-byte.
  • New phrases are appended at the end with empty translation columns.
  • Phrases no longer in the fresh extraction are moved to <locale>.obsolete.csv next to the locale file. Obsolete phrases are NOT commented in-line — Magento's translation loader does not tolerate comments inside the CSV.

Phase 4 — Validate

Via ${CLAUDE_SKILL_DIR}/scripts/validate-csv.sh:

  • Placeholder consistency: %1 count in source must match target.
  • Character encoding (UTF-8).
  • CSV well-formedness (correct quoting, no embedded newlines in unquoted fields).

Phase 5 — Report

{output_root}/i18n/{Vendor}_{Module}-{date}.md:

  • Phrases added per locale
  • Translations missing per locale
  • Placeholder mismatches per locale (if any)
  • CSV validation results

Inputs

/i18n [--locales=en_US,de_DE,fr_FR] [--machine-translate] [--module=<Vendor>_<Module>] [--docs-root=<path>]

--docs-root=<path> — output-root override; see "Output root" below.

Outputs

{ctx.magento_root}/app/code/{Vendor}/{Module}/i18n/{locale}.csv (updated)

{output_root}/i18n/{Vendor}_{Module}-{date}.md

{output_root} defaults to .docs ({ctx.docs_root}), anchored at the project root, never under {ctx.magento_root}, app/code, or a module dir. See the Artifact location rule in context/SKILL.md.

Output root (--docs-root)

This skill accepts --docs-root=<path> (see context/references/artifact-layout.md). When set, write the run report (and any report artifacts) under <path>/i18n/; otherwise default to {ctx.docs_root}/i18n/. feature passes this so a feature run's reports collect under its folder.

Reference Files

  • references/extraction-patterns.md — all translatable patterns + extraction regex.
  • references/csv-format.md — Magento CSV format rules.
  • references/placeholder-rules.md — %1 %2 etc. consistency.
  • references/machine-translation.md — provider integration (DeepL, Google, OpenAI).

Scripts

  • ${CLAUDE_SKILL_DIR}/scripts/extract.sh — Magento CLI wrapper or regex fallback.
  • ${CLAUDE_SKILL_DIR}/scripts/merge-csv.sh — deterministic merge: preserves translations, appends new phrases, separates obsolete phrases to <locale>.obsolete.csv.
  • ${CLAUDE_SKILL_DIR}/scripts/validate-csv.sh — CSV well-formedness + placeholder check.

Acceptance Criteria

  • Existing translations are never overwritten.
  • Phrases removed from code are written to <locale>.obsolete.csv, not commented in-line, and not deleted.
  • Placeholder mismatches between source and any locale are surfaced as findings.
  • CSV files are valid (parseable by Magento's translation loader).

Related Skills

PhaseSkill
0context

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.