Caputchin
Game customization

Customize a game's language

A game ships with the languages its author translated it into. On the Locale tab of the game's editor you can override those strings, fix a translation, adjust wording to match your product, or add a language the game did not ship, and the change applies to the rendered game.

Language customization is available from the Alpha plan up (Alpha, Troop, Apex).

Set the language strings

Open the game on a site key's (or the troop's) Games page, then the Locale tab. Each language the game offers is a preset, and each preset is a set of named strings (the in-game labels and messages). Edit the strings you want to change; leave the rest and they keep the game's bundled wording.

Locale fields are always plain text. There is nothing to pick but the words.

How a language is chosen at runtime

Each locale preset carries a language tag (en, es, fr, and so on), and presets are grouped by that tag. Picking one happens in two stages.

First the widget decides which language to ask for:

  1. The widget's locale attribute, if the page set one (explicit author intent).
  2. Otherwise, the visitor's browser language (the first of their preferred languages).
  3. Otherwise nothing, and the server falls back to the game's default.

Then the server matches that language against the presets, after merging your overrides (site key over troop over the game's bundled set), in this order:

  1. An exact tag match (pt-BR finds the pt-BR preset).
  2. The base language (pt-BR falls back to a pt preset).
  3. The preset you marked default.
  4. The game's first preset.

So a game with any presets always renders real text, never raw keys. You mark one preset per language as the default in the editor.

On the <caputchin-game> element you can also pass an inline locale object: a JSON object written as the attribute value, for example locale='{"start":"Go!"}'. The widget sends it to the server as that mount's language signal, and the server parses it and layers it on top of the resolved presets, so your inline strings win over everything above (including your troop and site-key overrides). It is a property of your own markup, so it works on any plan. The checkbox <caputchin-widget> does not accept an inline locale; its locale attribute takes only a language tag or preset name. See our philosophy for why this per-embed authoring is free.

Text direction (left-to-right or right-to-left) is derived from the language tag automatically, so a right-to-left language renders correctly without extra setup.

Add or extend a language

You can extend any language the game ships: the new preset inherits every string from the one you extend, and you override only the ones you change. To add a language the game did not ship, create a preset with that language's tag and fill in the strings.

What applies, and where

Language overrides resolve on the server, most-specific-wins: a site-key preset beats the troop preset, which beats the game's bundled language. The visitor's browser language selects which resolved preset they see.

See also

On this page