aymericzip/intlayer-skills / skills/intlayer-remix
intlayer-remix
VerifiedIntegrates Intlayer internationalization with Remix 3 applications. Use when the user asks to "setup Remix i18n", register the Intlayer router middleware, or use the "useIntlayer" / "useLocale" hooks in Remix route handlers and views.
Intlayer Remix Usage
Core Philosophy
Intlayer promotes Component-Level Content Declaration. Instead of a massive global translation file, content is declared in *.content.ts files adjacent to the views that use them.
Declare Content
File: src/views/home.content.ts
import { t, type Dictionary } from "intlayer";
const content = {
key: "home",
content: {
title: t({
en: "Welcome",
fr: "Bienvenue",
es: "Hola",
}),
},
} satisfies Dictionary;
export default content;
Setup
Register the intlayer() router middleware in createRouter(), before render(). It strips the locale prefix before route matching, so routes are declared once without a :locale segment.
Hooks
useIntlayer, useDictionary and useLocale read the request locale with no argument, anywhere downstream of the middleware (route handlers and remix/ui views).
import { useIntlayer, useLocale } from "remix-intlayer";
export const HomePage = () => () => {
const { locale, availableLocales } = useLocale();
const home = useIntlayer("home");
return <h1>{home.title}</h1>;
};
useIntlayer("home", "fr")overrides the request locale for one call.- Remix JSX is not React:
classis written as-is, and re-renders are triggered withhandle.update().- Outside of a request, the hooks fall back to the default locale.
Compiler
The Intlayer Compiler can extract all your content keys from your components, using one CLI command (npx intlayer extract) or automatically at app build.
References
Environments
Concepts
Packages
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |