lingui-js-macro

Implements LinguiJS i18n in JavaScript/TypeScript projects using @lingui/macro.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/elcoosp/elcoosp-skills --skill lingui-js-macro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lingui-js-macro
Source: https://github.com/elcoosp/elcoosp-skills/tree/main/lingui-js-macro
Command: npx skills add https://github.com/elcoosp/elcoosp-skills --skill lingui-js-macro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of internationalizing JavaScript applications by leveraging LinguiJS macros for efficient message extraction and management.

Core Features & Use Cases

  • Compile-time Extraction: Automatically extracts translatable strings using @lingui/macro.
  • ICU MessageFormat: Supports complex translations with plurals, selects, and rich text.
  • Workflow Automation: Integrates with CLI tools for seamless extraction and compilation.
  • Use Case: Integrate LinguiJS into a React application to manage translations for multiple languages, ensuring all user-facing text is correctly extracted and ready for translators.

Quick Start

Use the lingui-js-macro skill to extract all translatable strings from your project's source files.

Frequently Asked Questions about lingui-js-macro

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

FAQPage Schema
How do I extract translatable strings from my React application using LinguiJS macros?

Compile-time message extraction with `@lingui/macro` automatically identifies and collects user-facing text from your source files. By integrating the macros into your codebase, you prepare all translatable strings for the extraction and compilation workflow seamlessly.

What is the best way to handle complex translations with plurals and rich text in JavaScript i18n?

Handling complex translations with plurals and rich text in JavaScript i18n is best achieved using ICU MessageFormat. LinguiJS macros natively support this format, allowing you to define pluralization, select statements, and embedded components directly within your message definitions.

Why are my LinguiJS macros not extracting messages correctly during the build process?

Message extraction issues often stem from incorrect imports or using dynamic IDs within your macros. Ensure you are importing `t` and `Trans` directly from `@lingui/macro` and avoiding dynamically generated message IDs to allow the compiler to properly parse your strings.

Can I use LinguiJS macros to manage internationalization in a TypeScript project?

Yes, you can use LinguiJS macros to manage internationalization in both JavaScript and TypeScript projects. The macros provide type-safe wrappers around your translation components and functions, ensuring your extracted messages integrate smoothly with TypeScript's type checking.

How does the lingui extract and compile workflow process ICU MessageFormat strings?

The `lingui extract` command scans your codebase for `t` and `Trans` macro usages, compiling them into ICU MessageFormat message catalogs. The subsequent `lingui compile` step then transforms these catalogs into optimized JavaScript modules for your application to consume at runtime.