Zum Inhalt springen
ZokoGames

Anmelden

Diese Seite ist noch nicht übersetzt und wird auf Englisch angezeigt.

Localisation guide

Auf dieser Seite

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.

Etwas unklar, falsch oder fehlt auf dieser Seite? Schreib uns über den Support · Teste dein Spiel im Vorschau-Tool

Cookie-Einstellungen

Wähle, welche Cookies ZokoGames verwenden darf. Notwendige Cookies sind immer aktiv, weil die Seite ohne sie nicht funktioniert.

  • Anmeldung, Sprache und diese Einstellungen. Immer aktiv.

  • Merkt sich auf diesem Gerät zum Beispiel deine zuletzt gespielten Spiele.

  • Zählt Spiele und Seitenaufrufe mit einer zufälligen Besucher-ID, damit wir uns verbessern können.

  • Erlaubt personalisierte Werbung, die die kostenlosen Spiele finanziert.