Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provide additional context for messages based on the codebase and the context of the message to improve the quality of the translations.
.claude/skills/platformplatform-enhanced-message-context/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 139% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 101% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 26% | 0% |
| case-15 | ✓→✓ | = Same ✓ | 64% | 0% |
When implementing Lingui i18n, add translator comments to messages so translators have context to provide the best translation. Even when the message text is self-explanatory, it is important to know where and how it appears in the UI to choose the correct tone, length, and wording.
Add a comment field when the message:
{count} (count of what?), {name} (user name, file name, project name?)A good translator comment includes:
Lingui provides three ways to add translator comments:
t)For JavaScript code outside JSX:
jsimport { t } from "@lingui/core/macro"; // With comment const backLabel = t({ comment: "Button in the navigation bar that returns to the previous page", message: "Back", }); // With comment and variable const uploadSuccess = t({ comment: "Success message showing the name of the file that was uploaded", message: `File ${fileName} uploaded successfully`, });
Trans)For JSX elements:
jsximport { Trans } from "@lingui/react/macro"; // With comment <Trans comment="Button that deletes the selected email message">Delete</Trans> // With comment in a component <button> <Trans comment="Label for button that saves changes to user profile"> Save </Trans> </button>
defineMessage / msg)For messages defined separately from their usage:
jsimport { defineMessage } from "@lingui/core/macro"; const messages = { deleteButton: defineMessage({ comment: "Button that permanently removes the item from the database", message: "Delete", }), statusLabel: defineMessage({ comment: "Shows whether the service is currently operational. Values: 'Active', 'Inactive', 'Pending'", message: "Status: {status}", }), };
Before (no context):
jsx<button onClick={goBack}> <Trans>Back</Trans> </button>
After (with context):
jsx<button onClick={goBack}> <Trans comment="Button in the toolbar that navigates to the previous page"> Back </Trans> </button>
Before (no context):
jsxconst columns = [ { key: "name", label: t`Name` }, { key: "status", label: t`Status` }, ];
After (with context):
jsxconst columns = [ { key: "name", label: t({ comment: "Column header in the projects table showing project name", message: "Name" }) }, { key: "status", label: t({ comment: "Column header showing project status: Active, Inactive, or Archived", message: "Status" }) }, { key: "created", label: t({ comment: "Column header showing the date when the project was created", message: "Created" }) }, ];
Before (ambiguous):
jsx<button onClick={handlePost}> <Trans>Post</Trans> </button>
After (clarified as verb):
jsx<button onClick={handlePost}> <Trans comment="Button that publishes the content. Used as a verb (to post), not a noun (a post)"> Post </Trans> </button>
Before (unclear what count represents):
jsconst message = t`${count} items selected`;
After (clarified):
jsconst message = t({ comment: "Shows the number of email messages currently selected in the inbox", message: `${count} items selected`, });
jsx// Message is clear on its own; adding a comment with location still helps translators <Trans comment="Validation hint shown below the password field on the sign-up form"> Your password must contain at least 8 characters, including one uppercase letter and one number. </Trans>
When implementing or reviewing Lingui messages:
comment field with location, purpose, and any disambiguation| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | pass→pass | 11,907 | 6,032 | -49% | 1 | 1 | 0% | 2,024 | 2,559 | +26% | 0 | 0 | — |
case-15 | pass→pass | 9,367 | 4,399 | -53% | 1 | 1 | 0% | 1,439 | 2,355 | +64% | 0 | 0 | — |
case-01 | pass→pass | 5,995 | 3,444 | -43% | 1 | 1 | 0% | 976 | 2,167 | +122% | 0 | 0 | — |
case-02 | pass→pass | 7,704 | 3,333 | -57% | 1 | 1 | 0% | 1,327 | 2,149 | +62% | 0 | 0 | — |
case-03 | fail→pass | 5,619 | 3,183 | -43% | 1 | 1 | 0% | 885 | 2,118 | +139% | 0 | 0 | — |
case-04 | pass→pass | 7,164 | 2,407 | -66% | 1 | 1 | 0% | 1,192 | 2,007 | +68% | 0 | 0 | — |
case-05 | pass→pass | 3,975 | 4,222 | +6% | 1 | 1 | 0% | 671 | 2,278 | +239% | 0 | 0 | — |
case-06 | pass→pass | 11,757 | 3,958 | -66% | 1 | 1 | 0% | 1,947 | 2,178 | +12% | 0 | 0 | — |
case-07 | fail→pass | 5,923 | 3,303 | -44% | 1 | 1 | 0% | 1,011 | 2,117 | +109% | 0 | 0 | — |
case-08 | pass→pass | 6,389 | 3,150 | -51% | 1 | 1 | 0% | 1,061 | 2,135 | +101% | 0 | 0 | — |
case-09 | pass→pass | 10,621 | 4,305 | -59% | 1 | 1 | 0% | 1,861 | 2,391 | +28% | 0 | 0 | — |
case-11 | pass→pass | 5,384 | 3,579 | -34% | 1 | 1 | 0% | 909 | 2,080 | +129% | 0 | 0 | — |
case-12 | fail→pass | 5,867 | 3,069 | -48% | 1 | 1 | 0% | 1,008 | 2,025 | +101% | 0 | 0 | — |
case-13 | pass→pass | 4,858 | 3,291 | -32% | 1 | 1 | 0% | 810 | 2,132 | +163% | 0 | 0 | — |
case-14 | pass→pass | 9,049 | 3,596 | -60% | 1 | 1 | 0% | 1,597 | 2,183 | +37% | 0 | 0 | — |
case-16 | pass→pass | 6,863 | 3,811 | -44% | 1 | 1 | 0% | 1,180 | 2,227 | +89% | 0 | 0 | — |
case-17 | pass→pass | 6,024 | 3,403 | -44% | 1 | 1 | 0% | 1,026 | 2,165 | +111% | 0 | 0 | — |
case-18 | pass→pass | 13,114 | 11,152 | -15% | 1 | 1 | 0% | 2,164 | 3,479 | +61% | 0 | 0 | — |
case-19 | pass→pass | 5,944 | 3,161 | -47% | 1 | 1 | 0% | 963 | 2,094 | +117% | 0 | 0 | — |
case-20 | pass→pass | 5,189 | 5,982 | +15% | 1 | 1 | 0% | 786 | 2,640 | +236% | 0 | 0 | — |
case-21 | pass→pass | 4,093 | 4,665 | +14% | 1 | 1 | 0% | 717 | 2,366 | +230% | 0 | 0 | — |
case-22 | pass→pass | 5,871 | 5,973 | +2% | 1 | 1 | 0% | 1,116 | 2,699 | +142% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.