Chuyển đến nội dung
ZokoGames

Đăng nhập

Trang này chưa được dịch và đang hiển thị bằng tiếng Anh.

Localisation guide

Trong trang này

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.

Có điều gì chưa rõ, chưa đúng hoặc còn thiếu trên trang này? Báo cho chúng tôi qua hỗ trợ · Thử game của bạn trong công cụ xem trước

Cài đặt cookie

Chọn loại cookie mà ZokoGames được phép dùng. Cookie cần thiết luôn bật vì trang web không thể hoạt động nếu thiếu chúng.

  • Đăng nhập, ngôn ngữ và các lựa chọn này. Luôn bật.

  • Ghi nhớ những thứ như trò chơi bạn chơi gần đây trên thiết bị này.

  • Đếm lượt chơi và lượt truy cập trang bằng một mã khách ngẫu nhiên để giúp chúng tôi cải thiện.

  • Cho phép quảng cáo cá nhân hóa, nguồn thu giúp các trò chơi luôn miễn phí.