← All docsGetting started

Languages

Set one language for every Swarm script, override it per script, and edit or add translations.

Set your server's language

One setting changes the language of every Swarm script. Open swarm_bridge/config.lua and set SwarmConfig.Locale:

SwarmConfig.Locale = 'de'

Then restart the server. These languages ship with every Swarm script:

CodeLanguage
enEnglish
noNorwegian
deGerman
frFrench
esSpanish
pt-brPortuguese (Brazil)
nlDutch
plPolish
trTurkish
itItalian

Common alternative codes are understood too: nb and nn mean no, pt and br mean pt-br, and en-gb / en-us mean en.

If a line is missing from a translation, that line shows in English, so nothing ever appears blank.

Use a different language for one script

Every script follows Swarm Bridge by default, because its own setting is 'auto'. To force one script into another language, change that script's setting to a language code:

Config.Locale = 'auto'   -- follow swarm_bridge (default)
Config.Locale = 'fr'     -- always French, whatever the bridge says
ScriptSettingFile
Most Swarm scriptsConfig.Localeconfig.lua
Swarm DJConfig.Localeshared/config.lua
Swarm MulticharSwarmMulticharConfig.Localeconfig.lua
Swarm Loading ScreenSwarmLoadingscreenConfig.Localeconfig.lua

Change the wording or add a language

Each script keeps its text in a locales folder, with one file per language, for example swarm_fishing/locales/de.lua. Each file holds both the in-game messages and the on-screen menu text, so a translator only ever edits one file per language.

Change some wording

Open the language file you use, find the line and change the text between the quotes. Restart the script to see it.

Add a new language

  1. In the script's locales folder, copy en.lua to <code>.lua, for example sv.lua.
  2. At the top of the new file, change Locales['en'] to your code, for example Locales['sv'].
  3. Translate the text between the quotes. Don't change the names on the left.
  4. Set SwarmConfig.Locale = 'sv' in Swarm Bridge (or the script's own setting) and restart.
  5. Repeat for each Swarm script you want in that language. Scripts without the file fall back to English.
Locales = Locales or {}

Locales['sv'] = {
    dock_menu_title   = 'Fiskebrygga',
    buy_rod           = 'Köp %s ($%s)',
    not_enough_money  = 'Du har inte råd med det.',
    ui_boat_return_title = 'Lämna tillbaka båten',
    -- ...
}

Keep these exactly as they are

Looks likeWhat it is
%s, %d, %02dPlaceholders filled in by the script, such as a price or a name. Keep the same number of them, in the same order.
{0}, {name}Placeholders used by on-screen menus. Keep them as written.
~g~, ~r~, ~s~ and similarGTA colour codes. Keep them where they are.

Keys that start with ui_ are on-screen text: menus, buttons and labels in the script's interface. Everything else is in-game messages such as notifications.

What isn't in the language files

Names you set yourself in each script's config, such as item labels, zone names, ranks and blip names, aren't translated by the language files. Change them in that script's config.lua. The same goes for item names and descriptions in your inventory's item list.

Need help?

Ask in the Swarm Scripts Discord.