lingui-best-practices

Implement Lingui internationalization best practices for React and JavaScript applications.

1|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/babually/bongo-template --skill lingui-best-practices-babually
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lingui-best-practices
Source: https://github.com/babually/bongo-template/tree/main/.agents/skills/lingui-best-practices
Command: npx skills add https://github.com/babually/bongo-template --skill lingui-best-practices-babually

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement and maintain internationalization in React and JavaScript applications without breaking message extraction, locale switching, or translation quality.

Core Features & Use Cases

  • React and JavaScript i18n setup: Configure Lingui providers, macros, and runtime loading for web or native apps.
  • Translation workflow guidance: Extract messages, compile catalogs, and activate locales correctly across environments.
  • Best-practice troubleshooting: Avoid common pitfalls such as module-level macros, missing providers, unstable memoization, and incorrect import paths.
  • Use Case: Localize a multilingual product UI with translated buttons, forms, alerts, pluralized counts, and locale-aware dates and numbers.

Quick Start

Ask the Skill to add Lingui internationalization to your React app and show the correct provider, macro, extraction, and catalog workflow for your locale setup.

Frequently Asked Questions about lingui-best-practices

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

FAQPage Schema
How do I set up Lingui internationalization in a React app?

Lingui internationalization setup requires configuring I18nProvider, macros, and runtime loading for your React app. You must correctly wrap your UI components with the provider and import macros to enable message extraction and locale switching.

What is the best way to extract and compile Lingui message catalogs?

Extracting and compiling Lingui message catalogs involves running the CLI to pull translatable strings from macros into catalog files, then compiling them for runtime. This workflow ensures translations are correctly loaded and activated across your application environments.

Why does my Lingui macro break message extraction in React?

Lingui macro extraction breaks when macros are used at the module level rather than within component render scopes. Avoid missing providers, unstable memoization, and incorrect import paths to ensure proper translation message extraction.

How do I handle pluralization and locale-aware formatting with Lingui?

Pluralization and locale-aware formatting in Lingui are handled using specific macros within your message definitions. You can correctly pluralize counts and format locale-aware dates and numbers directly in your React UI components.

Can I use Lingui for JavaScript localization outside of React?

Lingui supports JavaScript localization alongside React implementations. You can apply the same message catalogs, macros, and locale switching workflows to web or native applications to localize translated buttons, forms, and alerts.