agentleFS
aymericzipaymericzip/intlayer/.agents/skills/intlayer-compat/SKILL.md

intlayer-compat

Skill863 starsChanged 13 days agoApache-2.0View on GitHub

Migrates an existing i18n library (i18next, react-i18next, next-intl, next-i18next, react-intl, vue-i18n, Lingui…) to Intlayer through compat adapters that keep the original API. Use when the user asks to "migrate from i18next / next-intl / vue-i18n", "keep useTranslation working", or adopt Intlayer without rewriting translation calls.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    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. Very specific:

    Run npx intlayer init --interactive: it creates intlayer.config.ts, installs the adapter and can keep existing JSON catalogs as the source …

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Intlayer Compat Adapters

Compat adapters expose the exact same public API as an existing i18n library, but serve translations from Intlayer dictionaries. Application code keeps calling useTranslation, useTranslations, useIntl, $t… with keys typed against the Intlayer dictionaries.

How it works

  1. Run npx intlayer init --interactive: it creates intlayer.config.ts, installs the adapter and can keep existing JSON catalogs as the source of truth via a sync plugin.
  2. Register the adapter's bundler plugin (<adapter>/plugin). It aliases the original imports to the adapter at build time, so no import is rewritten by hand.

Adapters

Existing libraryAdapterBundler plugin (<adapter>/plugin)
i18next@intlayer/i18nexti18nextVitePlugin
react-i18next@intlayer/react-i18nextreactI18nextVitePlugin
next-i18next@intlayer/next-i18nextcreateNextI18nPlugin
next-intl@intlayer/next-intlcreateNextIntlPlugin
use-intl@intlayer/use-intluseIntlVitePlugin
react-intl@intlayer/react-intlreactIntlVitePlugin
vue-i18n@intlayer/vue-i18nvueI18nVitePlugin
@lingui/core, @lingui/react@intlayer/linguilinguiVitePlugin

Lingui: keep the Lingui macro plugin (@lingui/babel-plugin-lingui-macro / @lingui/swc-plugin) running before the Intlayer compiler.

Features outside translation stay with the original library, e.g. next-intl/navigation (Link, redirect, usePathname). ICU messages (plural, select, #, formatted arguments) and rich formatting (t.rich, <Trans>) are resolved by Intlayer.

Migration guides also exist for Nuxt I18n, NGX Translate, Transloco, Svelte I18n, Next Translate, Polyglot.js and i18n-js.

Keep Existing Catalogs: Sync Plugins

To keep the current library and its message files, register a sync plugin in the plugins of intlayer.config.ts instead of (or alongside) an adapter. Intlayer then manages the catalogs (AI fill, CI tests, CMS) without changing the rendering runtime.

Catalog formatPackagePlugins
JSON@intlayer/sync-json-pluginsyncJSON, loadJSON
Gettext PO@intlayer/sync-po-pluginsyncPO, loadPO
  • sync* reads and writes back the files, keeping them in sync with the dictionaries.
  • load* only loads the files into dictionaries (never writes back), e.g. for catalogs fetched from a remote source.
  • syncJSON accepts format: 'intlayer' | 'icu' | 'i18next' | 'vue-i18n' to match the message syntax of the existing library.
  • Current scope: plain text and translations; insertions, plurals/ICU and the visual editor are not supported yet for synced files.

After migrating

Once the app runs on Intlayer, components can be moved progressively to the native API (useIntlayer + .content files) and the adapter removed.

References

Plugins

  • Sync JSON
  • Sync PO

Migration Guides

  • Compat Adapters Overview
  • i18next
  • react-i18next
  • next-i18next
  • next-intl
  • React Intl
  • Vue I18n
  • Lingui
  • NuxtJS I18n
  • NGX Translate
  • Transloco
  • Svelte I18n

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.