fix-nls-gaps

Detect and fix missing localization, hardcoded Chinese text, and untranslated defaultMessage strings in TypeScript codebases.

Updated May 13, 2026
One-click install
npx skills add https://github.com/lovebirdsx/universe-editor --skill fix-nls-gaps-lovebirdsx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-nls-gaps
Source: https://github.com/lovebirdsx/universe-editor/tree/main/.claude/skills/fix-nls-gaps
Command: npx skills add https://github.com/lovebirdsx/universe-editor --skill fix-nls-gaps-lovebirdsx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? User-facing text that bypasses the localize() pipeline causes Chinese strings to leak into English UIs, English defaults to appear in Chinese UIs, and untranslated literals to ship to users. This Skill systematically finds and fixes all three leakage patterns in a VSCode-style TypeScript monorepo. ## Core Features & Use Cases - Three-pattern scanning: grep-based detection of bare literals, Chinese defaultMessage arguments (including multi-line calls), and keys missing from zh-CN.ts. - Fix conventions: key naming rules, named placeholder interpolation, key reuse, module-evaluation timing pitfalls, and Monaco command label handling. - Full verification chain: prettier, platform rebuild, lint/typecheck/tests, unit test assertion migration, and e2e smoke runs with assertion-drift handling. - Use Case: A user reports Chinese text appearing on the English interface. Run the scan commands to locate the offending localize call, replace the Chinese defaultMessage with English, add the translation to zh-CN.ts, then run the verification chain to catch stale test assertions. ## Quick Start Ask the assistant to find and fix all unlocalized user-facing text and Chinese strings leaking into the English UI in this repository.

Frequently Asked Questions about fix-nls-gaps

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

FAQPage Schema
How do I find hardcoded Chinese text in a TypeScript codebase?

Run a grep with the Unicode range [\x{4e00}-\x{9fff}] over your src directories, excluding tests, comments, message tables, and existing localize calls. This surfaces bare literals that bypass the localization pipeline.

How to fix Chinese text appearing in the English UI?

The defaultMessage argument of localize() must be English because it is the final fallback when no translation exists. Replace the Chinese default with English text and add the Chinese translation under the same key in zh-CN.ts.

Why does the Chinese UI show English text after adding localize?

The key is missing from zh-CN.ts, so the fallback chain returns the English defaultMessage. Check whether the key exists in the Chinese message table and add the translation without changing the default.

Should log messages and CLI help text be localized?

No. Logs, console output, agent-facing prompts, search keyword tables, and CLI --help text are deliberate exclusions. CLI help may print before NLS initialization and follows English convention.

Why do e2e tests fail after changing localized strings?

E2e fixtures pin the language to en-US, so assertions match the defaultMessage text, not translations. After changing a defaultMessage or wrapping raw text in localize, grep the e2e specs for the old string and update UI-copy assertions.