WhereiamL
whereiaml_arcade

Localization

Every string on the screen comes from the locale files, so you can translate the whole thing without touching the UI.

the resource ships with en and de. every piece of text on the screen (the menu, game over, scores, the button labels under the screen, all of it) is read from the locale files and handed to the interface when it opens. nothing user-facing is hardcoded in the ui, so translating it is just editing a json file.

how it works

on open, the client reads each string with locale(...) and sends them to the nui. that means the active locale (ox:locale) decides the language, and a missing key falls back to en.

adding a language

  1. copy locales/en.json to locales/<code>.json (for example fr.json).
  2. translate the values, keep the keys.
  3. set your server locale:
setr ox:locale fr

the game titles are left in english in the shipped locales on purpose (they read like arcade cabinet names), but they're just keys like everything else, so translate them too if you want.

the keys

  • ui: title, records, hint_menu, hint_records, hint_back, game_over, score, best, saving, press_a, loading, no_scores, lives
  • the handheld shell: sub_label, btn_select, btn_start, controls_hint
  • game titles: g_badlands, g_turbo, g_cash, g_viper, g_leap, g_stacker, g_bricker
  • the payout notification: payout

On this page