Languages
The texts of Bablo Map Editor come from a JSON file in the locales folder: the editor, the tool panels, the Map Workshop, the confirm windows and the notifications. English (en.json) and Swedish (sv.json) ship with the resource.
There is one language for the whole server. Players cannot pick their own.
Server language
-- locale file to use: locales/<locale>.json ('en', 'sv' — copy en.json to add your own language)
Config.Locale = "en"locales/loader.lua loads locales/<locale>.json when the resource starts, on the server and on every player’s game. The game passes the texts on to the editor window when the window has loaded and each time the editor opens.
- A region part is ignored and capital letters don’t matter, so
"en-US"loadsen.json. - If the file is missing or empty,
en.jsonis used. - If the file is not valid JSON, the server console and the F8 console print
[bablo-mapeditor] could not load locales/<locale>.json, and the editor shows the key of every text, such asstudio.tab.maps, instead of the text.
A language file is only read when the resource starts. After you change one, run restart bablo-mapeditor.
Adding a language
-
Copy
locales/en.jsontolocales/<code>.json, for examplelocales/de.json. Use lower case letters and no-in the file name, because everything from the first-inConfig.Localeis dropped. -
Translate the values, never the keys, and keep the groups of
en.jsonas they are:JSON"hint": { "exit": "Beenden", "move": "Bewegen", -
Set the language in
config.lua:LUAConfig.Locale = "de" -
Run
refreshand thenrestart bablo-mapeditorin the server console, so the server picks up the added file.
Tips
- Keep every
%sin a value. It is replaced with a name or a number, in the same order as in English. - Keep the file valid JSON, with the same groups as
en.json. The script joins a group and a key with a dot, so"no_permission"inside"toast"becomestoast.no_permission. - Translate every key. A key that is missing from your file is not filled in from English: the editor and the notifications show the key itself, such as
studio.maps.create. en.jsonandsv.jsonhold the same keys, so either one works as a starting point.- The month and day names of the Workshop’s Schedule tab are in the file too, under
studio.schedule. Keep their keys (1to12,motosu). - Two English texts name numbers from
config.lua:toast.invalid_distance(50 to 2000, fromloadDistanceMinandloadDistanceMaxinConfig.Studio) andlight.shadow_hint(8, frommaxShadowsinConfig.Lights). If you change those settings, change the texts as well. - After an update, compare your file with the
en.jsonof the update and add the keys you don’t have yet.
Texts that are not in the language file
Some texts are set in config.lua, typed in game or fixed in the script:
| Text | Where it is set |
|---|---|
| The category names in the prop browser | label in Config.Categories, see Categories |
| The names of the GTA props in the prop browser | The prop catalogue data/props.json that ships with the resource |
| The names of your own props | label in Config.CustomProps, see Custom Props & Thumbnails |
| Map names, Workshop category names, prop labels, light names and schedule rule names | Typed by editors in game. The first map gets its name from Config.DefaultMapName, the first Workshop categories from the labels in Config.Categories. Changing the language later does not rename them. |
| The key labels of the key hint bar and the Keybinds tab | key in Config.Keybinds for Exit, Look, Free Cursor, Place, Brush, Rotate and Height, see Keybind hints. The other hints show the player’s own keys with names written by the script, such as SHIFT, CTRL and DEL. |
| The names of the key bindings in the GTA settings | Fixed English: Map Editor: free cursor and Map Editor: stop thumbnail run, see Commands |
| Units and short times | Fixed in the script: m and ° after numbers, and m, h and d in the Updated and When columns of the Workshop. Older dates use the date format of the game’s browser. |
| History entries for lights and schedule rules | The action shows with its internal name, for example Ran light_create |
| Console lines and the messages of the test, thumbnail and catalogue commands | Fixed English, for example [bablo-mapeditor] Database ready: 9 tables checked. |

