s&box
RustCounter-Strike 2s&boxDeadlock
Wiki
Get s&box on Steam
Browse
OverviewGetting StartedCreating GamesEngine & ToolsDocumentationCommunity GamesResources
s&boxDocumentationUiLocalization
SOURCE 2 · C#
Build and play games with s&box.

Facepunch's game engine and creation platform — make games in C#, or jump straight into community games.

Get s&box on Steam

s&box Wiki

  • Overview
  • Getting Started
  • Creating Games
  • Engine & Tools
  • Documentation
  • Community Games
  • Resources

Tools & Community

  • Getting Started
  • Creating Games
  • Engine & Tools
  • Resources

Platforms

  • RustBattle
  • CSBattle
  • Rust Game Wiki
  • CS2 Skins Wiki
  • Deadlock Wiki

About

  • Official Site
  • Developer Wiki
  • GitHub
  • Get on Steam
NOT AFFILIATED WITH FACEPUNCH STUDIOS · © 2026 s&box Wiki (community)
Docs/UI
UI

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.

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

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>

Sometimes you need to display text which has to be mixed with names of players, other items and so on. You will need to use a more advanced technique to display those strings.

First, in your localization file, add placeholders using braces like this:

  "player.join": "{Name} has joined the game",
  "player.leave": "{Name} has left the game",

Then, use Language.GetPhrase to substitute that placeholder with your desired text:

    var data = new Dictionary<string, object>();
    data["Name"] = connection.DisplayName;
    var message = Language.GetPhrase( "player.join", data );

Make sure to tell your localization team to leave the text inside the placeholder intact, even in different 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

Source: Facepunch/sbox-docs (CC-BY-4.0) · updated 2024-09-24. Read it rendered on the official docs.

More in UI

HudPainter
Razor Components
Razor Panels
Style Properties
Styling Panels
UI
UI Interactions
VirtualGrid
← All documentation

Community wiki — not affiliated with Facepunch Studios. For the latest and most authoritative information, see the official developer wiki.