i18n-messages

Guides editing of nls.localize message strings and placeholder tokens in Salesforce VS Code extensions.

1.0k|454|Updated Jun 21, 2017
One-click install
npx skills add https://github.com/forcedotcom/salesforcedx-vscode --skill i18n-messages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n-messages
Source: https://github.com/forcedotcom/salesforcedx-vscode/tree/main/.claude/skills/i18n-messages
Command: npx skills add https://github.com/forcedotcom/salesforcedx-vscode --skill i18n-messages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Editing internationalized message strings in the Salesforce VS Code extension codebase is error-prone: placeholder tokens behave differently under node:util.format, arg-count mismatches silently render literal tokens, and style conventions vary per UI surface. This Skill encodes those rules so message edits are correct and consistent.

Core Features & Use Cases

  • Placeholder semantics reference: Documents how %s, %d, %i, %f, %j, %o, %O, %c, and %% behave under node:util.format, including the unsupported %n token and the arg-count validation regex gotcha.
  • Per-surface style guide: Defines capitalization and punctuation conventions for command titles, QuickPick placeholders, confirm prompts, notifications, buttons, tree labels, logs, and validation errors.
  • Reuse-first workflow: Instructs checking package.nls.json for existing equivalent strings before adding new ones, and forbids severity prefixes like "Error:" that duplicate the show*Message API.
  • Use Case: When adding a new notification such as "Deleted %d orgs", use this Skill to pick the right token (%d not %n), match sentence-case style with terminal punctuation, and avoid duplicating an existing string.

Quick Start

Ask the AI to add or update an nls.localize message in packages/*/src/messages/i18n.ts following the i18n-messages conventions.

Frequently Asked Questions about i18n-messages

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

FAQPage Schema
How do I add a new nls.localize message in a Salesforce VS Code extension?

Add the string to the extension's src/messages/i18n.ts file and reference it via nls.localize with a key. First grep package.nls.json for an existing equivalent string to reuse rather than duplicating.

Which placeholder token should I use in nls.localize strings?

Use %d for counts and numbers, %s for strings, %f for floats, and %j for JSON values. Substitution runs through node:util.format, so %n is unsupported and renders literally.

Why does my nls.localize string show a literal %n or unmatched token?

The %n token is not supported by node:util.format and prints literally. Missing arguments are not filled either, so trailing unmatched tokens render as-is; only extra args are trimmed after a logged warning.

Should I prefix error messages with "Error:" or "Warning:" in VS Code notifications?

No. The showErrorMessage and showWarningMessage APIs already convey severity, so prefixes are redundant. Existing legacy strings with such prefixes are an anti-pattern and should not be copied.

What capitalization style should VS Code command titles and buttons use?

Command titles, button labels, and tree or status-bar labels use Title Case with no terminal punctuation. QuickPick placeholders, notifications, and validation errors use sentence case, with terminal punctuation for prompts and notifications.