s&box docs

Localization

When displaying text such as Hello World, you should instead use a localization token like #menu.helloworld. This will automatically replace the text with the corresponding language set by the user when set on a Label, allowing you to easily support multiple languages.

When displaying text such as Hello World, you should instead use a localization token like #menu.helloworld. This will automatically replace the text with the corresponding language set by the user when set on a Label, allowing you to easily support multiple languages.

Tokens

In UI, any displayed string that begins with a # will be recognized as a token, which means it will look for it's real value in the localization system.

Example

Filename: Localization/en/sandbox.json

{
  "menu.helloworld": "Hello World",
  "spawnmenu.props": "Models",
  "spawnmenu.tools": "Tools"
  "spawnmenu.cloud": "sbox.game",
}

Then it's as easy as doing the following:

<label>#spawnmenu.props</label>

Languages

English NameAPI Language Code
Arabicar
Bulgarianbg
Simplified Chinesezh-cn
Traditional Chinesezh-tw
Czechcs
Danishda
Dutchnl
Englishen
Finnishfi
Frenchfr
Germande
Greekel
Hungarianhu
Italianit
Japaneseja
Koreanko
Norwegianno
Pirateen-pt
Polishpl
Portuguesept
Portuguese-Brazilpt-br
Romanianro
Russianru
Spanish-Spaines
Spanish-Latin Americaes-419
Swedishsv
Thaith
Turkishtr
Ukrainianuk
Vietnamesevn

Referenced API

Canonical API pages mentioned in this guide.

Created at:
Updated at:

On this page