Aller au contenu
ZokoGames

Se connecter

Cette page n'est pas encore traduite et s'affiche en anglais.

Localisation guide

Sur cette page

Localisation guide

English is required for every visible string. Extra languages are welcome and help the game reach more players, but they never replace English. This guide covers the technical side.

Pick the language#

SDK.user.systemInfo.locale is a BCP 47 tag such as "en-US", "pt-BR" or "de". countryCode is an ISO country code such as "BR".

const SUPPORTED = ["en", "es", "pt", "de", "fr"];

function pickLanguage() {
  const raw = SDK.environment !== "disabled" ? SDK.user.systemInfo.locale : navigator.language;
  const base = String(raw).toLowerCase().split("-")[0];
  return SUPPORTED.includes(base) ? base : "en";
}

Rules:

  • Decide the language automatically. Do not make players choose before they can play. A small language switch in settings is fine.
  • Always fall back to English, for the whole game and for any single missing string.
  • In local mode the locale comes from your browser's language and the country is always "US". Change the browser language to test, or force a language with your own query parameter.
  • The Preview tool shows what the portal reports to the game.

Keep strings out of code#

const STRINGS = {
  en: { play: "Play", gameOver: "Game over", score: "Score: {n}" },
  es: { play: "Jugar", gameOver: "Fin del juego", score: "Puntos: {n}" },
};

function t(key, vars = {}) {
  const table = STRINGS[lang] ?? STRINGS.en;
  const raw = table[key] ?? STRINGS.en[key] ?? key;
  return raw.replace(/\{(\w+)\}/g, (_, k) => String(vars[k] ?? ""));
}
  • Use named placeholders ({n}), never string concatenation. Word order differs between languages.
  • Use Intl.NumberFormat(locale) and Intl.DateTimeFormat(locale) for numbers and dates.
  • Use Intl.PluralRules(locale) for plurals; many languages have more than two forms.
  • Load only the language you need, so translations do not grow the initial download.

Layout and fonts#

  • Text expands: German and Finnish are often 30 percent longer than English. Size buttons from their content and test with the longest language.
  • Right-to-left languages (Arabic, Hebrew) need mirrored layout and dir="rtl". Only ship them when you have tested them.
  • Pick a font that covers your scripts. A pixel font with only Latin glyphs shows empty boxes for Cyrillic or CJK. Subset fonts to keep them small.
  • Do not bake text into images. Put it in a text layer so it can be translated.

Engines#

  • Unity: the Localization package or your own table; read the locale from the wrapper's system info before the first scene loads.
  • Godot: TranslationServer.set_locale() with the SDK locale.
  • Construct 3: a language object or the Localization plugin.
  • Phaser and library games: your own table as above.

See the engine pages for how each wrapper exposes systemInfo.

Listing text#

The title, descriptions and controls you enter in the console are in English. Make sure the in-game controls text matches the description. Other languages inside the game do not need separate listing text.

Checklist#

  • Every visible string, including errors and the tutorial, exists in English.
  • Language is chosen from systemInfo.locale with an English fallback.
  • Longest translation still fits every button.
  • Fonts contain the glyphs for each shipped language.
  • No language prompt blocks the first play.

Quelque chose d'obscur, d'erroné ou de manquant sur cette page ? Dites-le-nous via le support · Testez votre jeu dans l'outil d'aperçu

Paramètres des cookies

Choisissez les cookies que ZokoGames peut utiliser. Les cookies nécessaires sont toujours actifs, car le site ne peut pas fonctionner sans eux.

  • Connexion, langue et ces choix. Toujours actifs.

  • Mémorise des éléments comme vos jeux récemment joués sur cet appareil.

  • Compte les parties et les visites de pages avec un identifiant de visiteur aléatoire pour nous aider à nous améliorer.

  • Autorise les publicités personnalisées, qui financent les jeux gratuits.