Guides localizing a TypeScript browser game: string tables with stable IDs, Intl API plurals/formatting, RTL/CJK layout, canvas text, fonts, pseudo-localization, and translation workflow.
Ships in game-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Internationalize from the first string: externalize text, format through Intl, and turn on a pseudo locale. Translation comes later and costs far less when the code is ready for it.
quest.ruins.offer, hud.gold.label), not by the English text. One English string can need different translations: Mozilla's example is "bookmark" as noun and verb, and Godot notes the same ambiguity with plain-English source strings, as opposed to message codes.`${name} found ${n} ${item}` in client and server code.Copy boilerplate/string-table.ts when you need a typed string table: IDs typed from the source table, a comment and optional length budget on every entry, plural messages that require other, the fallback chain below, catalogs loaded in parallel, and failed loads recorded in loadErrors instead of failing the whole table. Its {name} placeholders and plural maps are a minimal stand-in, not ICU MessageFormat. Move to a real message format when a message needs gender or nested choices.
Resolve from most to least specific, then the default locale: zh-Hans-CN, zh-CN, zh-Hans, zh, then en. Unreal processes cultures in that order. Add the likely script for a tag that has only a region, so zh-TW reaches a zh-Hant catalog (zh-TW, zh-Hant-TW, zh-Hant, then en). Skip the bare language when its likely script differs from the requested one: a bare zh catalog is usually Simplified and a bare sr one Cyrillic, so zh-TW and sr-Latn must not fall back to them. That skip is this skill's rule. The boilerplate does both with Intl.Locale.prototype.maximize(). Unity lets each locale list its fallbacks. Godot falls back to a project fallback locale, or to en.
brazilian to pt-BR, latam to es-419, schinese to zh-CN.Do not hard-code singular and plural. CLDR gives English one and other; Russian and Polish one, few, many and other; Arabic all six categories; Japanese only other. Brazilian Portuguese (pt) and French put 0 in one; European Portuguese (pt-PT) does not. Every plural or select message needs a default branch: other in ICU syntax, * in Fluent.
| Need | Intl member | Note |
|---|---|---|
| Plural branch, 1st/2nd/3rd | Intl.PluralRules | type: 'ordinal' for ordinals |
| Counts, HUD numbers | Intl.NumberFormat | notation: 'compact' for short forms |
| Real money | Intl.NumberFormat | style: 'currency' has no default currency; pass an ISO 4217 code |
| Event times | Intl.DateTimeFormat | set timeZone to the player's zone; formatRange for windows |
| "in 3 days", "yesterday" | Intl.RelativeTimeFormat | you pick the unit; numeric: 'auto' gives words |
| Reward lists, party names | Intl.ListFormat | conjunction, disjunction or unit; never join with ", " and " and " |
| Name length, truncation, wrapping | Intl.Segmenter | grapheme for length, word for Japanese, Chinese, Thai |
| Sorting names | Intl.Collator | leaderboards, inventories |
| Language picker | Intl.DisplayNames | language names in their own language |
In-game soft currency (gold, gems) is not ISO 4217. Format the number with NumberFormat and put the currency word in the message, where it can take a plural.
Copy boilerplate/intl-format.ts when you need these helpers with cached formatters: plural and ordinal category, compact numbers, money, lists, event windows in the player's zone, relative time with the unit picked for you, grapheme truncation, canvas word wrap, name sorting and language names.
Test plural messages with 0, 1, 2, 3, 5, 11, 21, 100 and 1000000 in every shipped locale. Those numbers hit different categories across Arabic, Russian, Polish, both Portuguese variants and French.
Browsers have these members: MDN marks Intl.PluralRules baseline since September 2019, RelativeTimeFormat since September 2020, ListFormat since April 2021 and Segmenter since April 2024. Bun's Web APIs page does not list Intl. Before server code relies on Intl, run this on the target Bun version:
bun -e 'for (const k of ["PluralRules","NumberFormat","DateTimeFormat","ListFormat","RelativeTimeFormat","Segmenter","DisplayNames","Collator"]) console.log(k, k in Intl); console.log(new Intl.PluralRules("ar").select(3), new Intl.PluralRules("pt").select(0), Intl.DateTimeFormat.supportedLocalesOf(["ar","ja","th","pt-BR"]))'
Every line should print true, then few one and all four locales. On Bun 1.4.4 on 2026-11-14 it did. That is one observation, not a documented guarantee: run it again in CI on the version you deploy, and add your shipped locales to the list.
| Option | Status checked 2026-11-14 | Pick when |
|---|---|---|
The boilerplate's {name} plus plural map | Code in this skill | Few plural strings, no gender, no nested choices |
| ICU MessageFormat (classic) | ICU documents plural and select arguments and full-sentence branches | Many plural or gender messages, translators or tools that already read ICU syntax |
| Fluent | Comments bound to messages, terms with variants, required default variant | Text-heavy games with brand terms and grammar that varies by language |
| MessageFormat 2 | Unicode TR35 Part 9, CLDR 49, stable; functions marked Draft may still change. In ICU4C and ICU4J. The TC39 Intl.MessageFormat proposal is at Stage 1 | A JS library you choose supports it; do not wait for native support |
No native JavaScript message formatter ships today: ICU MessageFormat, Fluent and MF2 all need a library on Bun and in browsers. Pick the library from its own documentation and pin its version. This skill names none because none was checked.
Short strings grow the most. W3C, quoting IBM, gives 200 to 300 percent for English strings of up to 10 characters and about 130 percent for strings over 70. Buttons and HUD labels break first. Let text reflow and avoid small fixed-width boxes.
Canvas fillText never wraps; its maxWidth squeezes or shrinks the text instead. Wrap with wrapLines from the boilerplate, or draw long text in DOM overlays. In a DOM overlay, insert translated text and player names with textContent, never innerHTML: a catalog or a player name can carry markup. That is this skill's own rule.
Read references/text-layout.md when you lay out HUD, menus, dialogue boxes or subtitles for more than one language: expansion budgets, canvas wrapping, right-to-left and bidi, CJK and Thai line breaking, French punctuation, fonts and glyph coverage, text in images and video, player names.
Run a pseudo locale from the first build, before any translation (Microsoft). It shows:
fake_bidi).Name the pseudo locale with a tag that is not a real language. Microsoft once used tk-TM; when Windows later shipped Turkmen, the clash caused bugs. ICU reserves en-XA (accents) and en-XB (bidi); Windows uses the qps- range.
Copy boilerplate/pseudo-localize.ts when you add the pseudo locale: it accents letters, pads, brackets, optionally mirrors, keeps {placeholders}, tags, entities and printf tokens intact, and builds a catalog under en-XA from the source table. It understands only this boilerplate's {name} syntax; for ICU or Fluent messages use the library's own pseudo-locale, since this one would accent ICU keywords such as plural and one. Intl resolves en-XA to en (checked on Bun 1.4.4), so numbers and plurals format as English. Serve it in development builds only.
Read references/process.md when you plan translation work or a content patch: glossary and style guide, context for translators, string freeze, the live-game cycle, LQA and culturalization.
The short version: give translators builds, context, a glossary, a style guide and name pronunciations before they start; freeze source text on a date the team commits to; run each live content patch as its own small localization cycle; regress localization fixes on more than one build; let the lead translator make the final call; change as little content as possible when culturalizing.
Store pages and in-game text are separate jobs. Steam decides language support from the in-game language settings, not the store page, and declares it per language as Interface, Full Audio or Subtitles.
+ joining translated pieces anywhere in UI code (rule 6). Search for it in review.one, pt-PT does not (CLDR).Intl.Segmenter). Slicing by code units splits emoji and accented letters; count graphemes.fillText to wrap (MDN).boilerplate/string-table.ts: copy when you need typed message IDs, translator comments, plural messages and the fallback chain.boilerplate/intl-format.ts: copy when you format numbers, money, dates, lists or relative time, or truncate or wrap text for canvas.boilerplate/pseudo-localize.ts: copy when you add the pseudo locale.references/text-layout.md: read when you lay out text for more than one language or script.references/process.md: read when you plan translation, a string freeze, LQA or culturalization.references/sources.md: read when you need the page behind a claim above.ui-ux-game (HUD, menus, subtitles and font-size options)character-design-narrative (character bibles and the dialogue-tree format whose lines become string-table entries)quest-mission-design (quest names, objective text)worldbuilding (world bible, factions and culture; the names and real-world parallels to review for culturalization)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/game-dev:game-localizationfrom game-dev
npx claudepluginhub fcsouza/agent-skills --plugin game-dev39 skills in this plugin
/betterauth-integrationCovers the game-specific layer of Better Auth: player, moderator and admin roles, session checks on game routes and WebSocket handshakes, and keeping the auth session apart from the game session. Use when a game needs player login, moderator or admin powers, or authenticated real-time connections, and the project uses Better Auth./bullmq-game-queuesBackground job design for game backends on BullMQ and Redis: one queue per game domain, idempotent reward fulfilment, and cron schedulers for daily rewards and season ends. Use when a game needs matchmaking requests, reward grants, match results, notifications or analytics processed off the request path, or recurring and timed jobs such as daily login rewards, leaderboard snapshots and season rollovers./Other plugins' skills for the same job