- Home
- Skills
- Translation & Localization
- intlayer react
intlayer react
Automate React internationalization using Intlayer for component-level content declarations and type-safe hooks.
Free
Works with the AI Agents you already use
intlayer react
Example session with this skill installed
Add i18n to a Navbar component with 'Home' and 'About' links in English and French using Intlayer.
- Read your context and instructions
- Compiled the intlayer react
- Generated the UI component
I have created the content declaration and the React implementation for your Navbar component using Intlayer's co-location pattern. ## Navbar Implementation **File:** `src/components/Navbar/navbar.content.ts` ```typescript import { t, type Dictionary } from "intlayer"; const navbarContent = { key: "navbar", content: { home: t({ en: "Home", fr: "Accueil", }), about: t({ en: "About", fr: "À propos", }), }, } satisfies Dictionary; export default navbarContent; ``` **File:** `src/components/Navbar/Navbar.tsx` ```tsx import React from "react"; import { useIntlayer } from "react-intlayer"; export const Navbar: React.FC = () => { const { home, about } = useIntlayer("navbar"); return ( <nav className="flex gap-4 p-4 border-b"> <a href="/" className="hover:text-blue-600"> {home} </a> <a href="/about" className="hover:text-blue-600"> {about} </a> </nav> ); }; ``` **Next steps** 1. Run `npx intlayer build` to compile the new dictionary keys. 2. Ensure `Navbar.tsx` and `navbar.content.ts` are in the same directory. 3. Wrap your application root with `IntlayerProvider` if not already present.
Navbar.tsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Managing large JSON translation files in React projects leads to merge conflicts, stale keys, and poor developer experience. This skill automates the implementation of Intlayer, a framework that moves internationalization directly into the component folder. It eliminates global dictionary management by generating localized content declarations and React implementation code. ## What it does - **Content declaration generation** creates `*.content.ts` files with type-safe dictionaries using the `t()` function for multiple locales. - **Hook implementation** writes React components utilizing `useIntlayer` to consume localized data with full TypeScript support. - **Environment configuration** provides setup instructions for Vite, Create React App, React Router v7, Tanstack Start, and React Native. - **Dictionary mapping** ensures unique keys are correctly mapped between declarations and component logic. - **Utility integration** configures specialized tools like MarkdownRenderer, date/number formatters, and locale switchers. ## How it works 1. **Define Content:** Specify the text and locales needed for a specific UI element. 2. **Generate Declaration:** The skill creates a `myComponent.content.ts` file adjacent to your component. 3. **Inject Logic:** Use the `useIntlayer` hook within your React component to access the defined keys. 4. **Compile:** Run the Intlayer compiler to extract keys and sync translations across the application. ## Frameworks & tools Specifically designed for React ecosystems including Vite, Expo, Astro, and Tanstack Start. It requires the `intlayer` and `react-intlayer` packages. ## Why this beats prompting it yourself Generic AI often defaults to outdated `i18next` patterns or manual JSON structures. This skill enforces Intlayer's component-level philosophy, ensuring your translations are co-located, type-safe, and ready for the Intlayer compiler without manual boilerplate. ## Use cases - Migrating a hardcoded React component to a multi-language setup. - Scaffolding localized components in React Native or Expo mobile apps. - Configuring internationalization for modern SSR frameworks like Tanstack Start. - Implementing localized Markdown rendering or complex data formatters. ## Known limitations Requires the @intlayer/mcp server for full automation. You must have a base Intlayer configuration file in your project root for the compiler to function correctly.
Requires @intlayer/mcp server. Project must have a central intlayer config file. Designed for component-level declaration, not legacy global JSON files.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Requires