Localize Update Skill
Use this skill when a user asks to convert existing hardcoded UI strings into localized strings.
Purpose
Apply minimal, targeted localization updates in TSX files by wrapping user-facing literals in loc("...").
Scope Rules
- •Target only user-facing strings requested by the user.
- •Prefer minimal edits; do not refactor unrelated logic.
- •Preserve existing component behavior and structure.
- •Skip scan exclusions from
localize-search:- •Files under
src/shared/** - •Lines marked with
localize-scan-ignore - •Strings inside
<code>...</code>blocks - •Language tab labels
TS,HTML,CSS,Librariesinsrc/components/PageEdit.tsx
- •Files under
Update Workflow
- •Identify target strings and file locations.
- •Include a quick scan for common missed patterns before editing:
- •Hardcoded tooltip/content props (for example
content="...",tip="..."). - •Hardcoded section/drawer/header text nodes not wrapped in
loc("..."). - •JSX text literals between tags in
src/components/**.
- •Hardcoded tooltip/content props (for example
- •Include a quick scan for common missed patterns before editing:
- •In each target TSX file:
- •Wrap hardcoded UI strings as
loc("..."). - •Add
locimport when missing:import { loc } from "../core/localize/loc";(adjust relative path as needed).
- •Wrap hardcoded UI strings as
- •Run extraction:
- •Windows:
cmd /c "npm run extract-loc" - •macOS:
zsh -lc "npm run extract-loc"
- •Windows:
- •Validate:
- •Confirm no obvious placeholder/format regressions.
- •Spot-check generated localization artifacts (
localize/extract-loc.tsv, language map, enums) to make sure newly wrapped strings are included. - •Ensure no new errors or warnings in the console.
- •Report:
- •Commands run
- •Files changed
- •Any follow-up needed (typically run
localize-stringsnext)
Notes
- •English is fallback when translations are missing.
- •Brand/product names are not auto-ignored; verify each new case before exclusion.
- •This skill does not run translation/embed; use
localize-stringsfor localization artifacts. - •Do not add new dependencies.
- •Keep TSV/JSON formatting tool-driven via project scripts.