enhanced-message-context

Add translator comments to Lingui i18n messages for accurate translations.

3|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/langgenius/due-date-hq-jwl --skill enhanced-message-context-langgenius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enhanced-message-context
Source: https://github.com/langgenius/due-date-hq-jwl/tree/main/.agents/skills/enhanced-message-context
Command: npx skills add https://github.com/langgenius/due-date-hq-jwl --skill enhanced-message-context-langgenius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Translators often receive isolated strings without UI context, leading to mistranslations of ambiguous words like "Back" or "Post". This Skill guides you to add translator comments to Lingui messages so translators understand location, purpose, and meaning before translating. ## Core Features & Use Cases - Ambiguity Detection: Identifies messages that need comments, such as short ambiguous words, unclear variables, and domain-specific terms. - Comment Writing Guidance: Provides a structure for effective comments covering UI location, action or purpose, and disambiguation of part of speech. - Full Lingui API Coverage: Shows how to add comments using the t macro, the Trans React component, and defineMessage for deferred messages. - Use Case: When internationalizing a React app with Lingui, review each message and add comments like "Button in the toolbar that navigates to the previous page" so translators produce correct, context-aware translations. ## Quick Start Review the Lingui messages in my React components and add translator comments to any message that is ambiguous or lacks UI context.

Frequently Asked Questions about enhanced-message-context

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

FAQPage Schema
How do I add translator comments in Lingui?

Add a comment field to the t macro or defineMessage, or use the comment prop on the Trans component in JSX. The comment is extracted into message catalogs so translators see it alongside the source string.

When should I add translator comments to i18n messages?

Add comments when a message is ambiguous, lacks UI context, has domain-specific meaning, depends on grammatical gender, or uses unclear variables. Short words like "Back" or "Post" that can be different parts of speech always need clarification.

Do Lingui translator comments affect production bundle size?

No, translator comments are stripped from production builds and carry zero runtime cost. They only appear in extracted message catalogs and translation management systems.

What makes a good translator comment for i18n strings?

A good comment includes the UI location, the action or purpose of the message, and disambiguation of part of speech or meaning. For example, "Button in the toolbar that navigates to the previous page" clarifies that "Back" is a navigation verb.

Can I add comments to lazy or deferred Lingui messages?

Yes, use defineMessage with a comment field for messages defined separately from their usage. This works the same way as the t macro and the comment is extracted into catalogs for translators.