WeChat Mini Games Overseas Localization Workflow
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md and install @tencent-adm/minigame-i18n.
About this skill
The Problem
When localizing WeChat mini games for overseas markets, Chinese text is often spread across JS/TS strings, JSON, CSV/TSV, WXML, Cocos scenes, Unity resources, UI images, and compiled artifacts. Manual searches can miss configuration tables or same-text strings in comments, while blind batch replacement can break template literals, concatenated expressions, i18n initialization, and language resource mappings. This skill turns overseas localization into an executable workflow: confirm project path, engine, localization strategy, and target languages, then scan, plan, translate, replace, and verify.
How It Works
The skill is script-first to avoid direct AI edits. scan-chinese.js extracts Chinese string literals with AST parsing across JS, TS, JSON, CSV/TSV, WXML, Cocos, Unity, C#, XML, and other formats, and pairs the scan with grep cross-checking to reduce omissions. If image localization is enabled, the workflow uses the MCP image translation chain: upload, OCR, translation, replacement, and verification are handled through scripts or MCP tools rather than asking the model to inspect images directly.
Translation generates an execution plan and glossary, then pauses for confirmation before replacement, keeping game terms, brand names, and UI phrasing consistent. Resource application supports two strategies: direct replacement of Chinese strings with target-language text, or language-pack generation with code converted to calls such as i18n.t("key"). replace-text.js provides backups, dry-run, per-entry validation, per-file rollback, and final verification; generate-langpack.js supports Cocos Creator, LayaAir, Egret, Unity, and native WeChat mini games. verify-build-strings.js can perform a second pass on compiled artifacts for residual Chinese text.
Boundaries
Best suited for WeChat mini games where localization is mainly code and static resources, especially projects with configuration tables, engine assets, and UI text. Image translation depends on MCP service availability and project credentials; if unavailable, suspected image text can be flagged while the text pipeline continues. Replacement does not start until the glossary is confirmed. Build-output verification is optional, and dynamically composed or runtime-generated text still needs manual review against the engine-specific logic.
Use Cases
- Before overseas launch of a Cocos mini game, scan Chinese text in code and JSON, then generate a glossary.
- Localize WeChat mini game configuration tables by translating and replacing Chinese names in CSV files.
- Refactor a native mini game with a language pack by replacing hard-coded Chinese with `i18n.t` calls and deploying the pack.
- Before build review, locate residual Chinese in packaged JS and verify whether any strings were missed.
Best For
- WeChat mini game front-end engineers who need to convert Chinese strings in `JS/TS` into maintainable `i18n` calls.
- Game localization engineers who need a glossary and full coverage of text, configuration tables, and image translation.
- Cocos or Unity engine developers who need engine-specific language packs and validation of injected initialization code.
- Overseas launch leads who need to confirm execution plans and terminology before replacement to avoid breaking code.
Related Skills
A one-shot coding agent built on Claude Code CLI that runs non-interactively, supports a specified workdir, and can be monitored in the foreground or background.
Preview and confirm file sorting by extension, with recursive cleanup, ignore rules, and transactional rollback.
An engineering assistant for static HTML/CSS/JS pages, design-token extraction, IE8-compatible review, and structured delivery.
An engineering workflow for requirement analysis, scenario modeling, risk planning, quality gates, testing, and knowledge capture, with lightweight, standard, and full modes.