menu_bookDocumentation

Localization (i18n)

calendar_today May 3, 2026 schedule ~1 min read person patrickjr verified 50

Localization (i18n)

Support multiple languages using localization tokens.

How It Works

Use tokens starting with # in UI strings. The system replaces them based on the user's language.

Creating Translation Files

Create JSON files in Localization/{language}/:

JSON
// Localization/en/sandbox.json
{
  "menu.helloworld": "Hello World",
  "spawnmenu.props": "Models",
  "spawnmenu.tools": "Tools",
  "spawnmenu.cloud": "sbox.game",
  "game.kill": "{player1} killed {player2}"
}

Using in Razor UI

RAZOR
<label>#spawnmenu.props</label>
<button>#menu.helloworld</button>

Available Languages

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

C# API

CSHARP
// Get localized string
string text = Sandbox.Localization.GetString("#menu.helloworld");

// Format with variables
string killMsg = Sandbox.Localization.Format("#game.kill", player1.Name, player2.Name);

Best Practices

Was this helpful?