lingui-best-practices

Standardize Lingui i18n patterns for React and JavaScript applications.

2|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/Adonis0123/adonis-skills --skill lingui-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lingui-best-practices
Source: https://github.com/Adonis0123/adonis-skills/tree/main/.agents/skills/lingui-best-practices
Command: npx skills add https://github.com/Adonis0123/adonis-skills --skill lingui-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Lingui best practices provide a structured, safe approach to implementing i18n in React and JavaScript projects, preventing common pitfalls such as module-level translations, improper locale initialization, and misconfigured catalogs.

Core Features & Use Cases

  • Macro-based translation workflows with Trans, useLingui, and msg for JSX and non-JSX contexts.
  • Guidance for Next.js App Router, server/client initialization, and avoiding runtime locale errors.
  • Catalog configuration, extraction, compilation, and tooling guidance, plus ESLint plugin integration for catching mistakes early.

Quick Start

Ask me to apply Lingui best practices to your React or vanilla JS project to ensure correct i18n integration.

Frequently Asked Questions about lingui-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Lingui i18n in a Next.js App Router project?

Lingui i18n in Next.js requires proper server and client initialization to avoid runtime locale errors. You must follow a specific locale activation order and configure the provider setup correctly within the App Router structure to ensure safe translation rendering.

What is the best way to use Lingui macros for translations in React?

Lingui macros standardize translation workflows. Use the Trans macro for JSX contexts, useLingui for component logic, and msg for non-JSX contexts. Following these macro usage guidelines prevents module-level translation errors and ensures correct extraction.

How do I extract and compile Lingui catalogs in a JavaScript application?

Extracting and compiling Lingui catalogs involves configuring your locales and running tooling commands to generate translation files. Correct catalog configuration and execution prevent misconfigured catalogs and ensure all translations are bundled into your JavaScript application.

Does Lingui work with Plural patterns and how do I implement them?

Lingui supports Plural patterns for handling complex pluralization in i18n. Implementing them requires using the specific macro patterns provided by Lingui to ensure correct grammar across different locales without manual conditional logic in your React components.

Why does my Lingui locale initialization cause runtime errors?

Lingui locale initialization errors often stem from improper module-level translations or incorrect provider setup. Applying standardized best practices for configuration, locale activation order, and robust error handling resolves these common i18n runtime pitfalls.