Complete guide to get started with Roblox Slang in your project.
- Roblox Studio installed
- Basic knowledge of Luau scripting
- A Roblox game project (or create a new one)
Choose your preferred toolchain manager. All three options work identically - they automatically download the correct pre-built binary for your platform from GitHub Releases.
Rokit is the fastest and most modern toolchain manager.
# Add to your project
rokit add mathtechstudio/roblox-slang
# Or install globally
rokit add --global mathtechstudio/roblox-slangrokit.toml:
[tools]
roblox-slang = "mathtechstudio/roblox-slang@2.0.2"Note: Aftman is no longer actively maintained. We recommend using Rokit or Foreman for new projects.
Aftman provides exact version dependencies and trust-based security.
# Add to your project
aftman add mathtechstudio/roblox-slang
# Or install globally
aftman add --global mathtechstudio/roblox-slangaftman.toml:
[tools]
roblox-slang = "mathtechstudio/roblox-slang@2.0.2"Foreman is the original Roblox toolchain manager, battle-tested in production.
foreman.toml:
[tools]
roblox-slang = { github = "mathtechstudio/roblox-slang", version = "2.0.2" }foreman installDownload pre-built binaries from GitHub Releases:
roblox-slang-2.0.2-linux-x86_64.ziproblox-slang-2.0.2-linux-aarch64.ziproblox-slang-2.0.2-windows-x86_64.ziproblox-slang-2.0.2-windows-aarch64.ziproblox-slang-2.0.2-macos-x86_64.ziproblox-slang-2.0.2-macos-aarch64.zip
Extract the archive and add the binary to your PATH.
# Install from crates.io
cargo install roblox-slang
# Or build from source
git clone https://github.com/mathtechstudio/roblox-slang.git
cd roblox-slang
cargo install --locked --path .roblox-slang --versionYou should see: roblox-slang 0.1.0
Navigate to your Roblox project directory and run:
roblox-slang initThis creates:
slang-roblox.yaml- Configuration filetranslations/- Directory for translation files
Edit slang-roblox.yaml:
# Base locale (fallback when translation missing)
base_locale: en
# List of supported locales
supported_locales:
- en
- es
- id
# Where to find translation files
input_directory: translations
# Where to generate Luau code
output_directory: src/shared/Translations
# Localization mode (NEW in v2.0.2)
localization:
# embedded: Translations embedded in code (default, no cloud dependency)
# cloud: Use Roblox Cloud LocalizationService only
# hybrid: Try cloud first, fallback to embedded
mode: embeddedCreate translations/en.json:
{
"welcome": "Welcome to my game!",
"ui": {
"buttons": {
"play": "Play",
"settings": "Settings",
"quit": "Quit"
},
"messages": {
"loading": "Loading...",
"playerJoined": "{name} joined the game"
}
}
}Create translations/es.json:
{
"welcome": "¡Bienvenido a mi juego!",
"ui": {
"buttons": {
"play": "Jugar",
"settings": "Configuración",
"quit": "Salir"
},
"messages": {
"loading": "Cargando...",
"playerJoined": "{name} se unió al juego"
}
}
}roblox-slang buildThis generates:
src/shared/Translations/Translations.lua- Main modulesrc/shared/Translations/types/Translations.d.luau- Type definitionssrc/shared/Translations/roblox_upload.csv- CSV for Roblox Cloud
In a LocalScript or Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Translations = require(ReplicatedStorage.Translations)
-- Create translation instance
local t = Translations.new("en")
-- Use translations
print(t:welcome()) -- "Welcome to my game!"
print(t.ui.buttons:play()) -- "Play"
-- With parameters
print(t.ui.messages:playerJoined({ name = "Player1" }))
-- Output: "Player1 joined the game"
-- Switch locale at runtime
t:setLocale("es")
print(t:welcome()) -- "¡Bienvenido a mi juego!"For multiplayer games, automatically use player's locale:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Translations = require(ReplicatedStorage.Translations)
Players.PlayerAdded:Connect(function(player)
-- Reads the player's Roblox account language setting (player.LocaleId)
local t = Translations.newForPlayer(player)
-- Send localized welcome message
local welcomeMsg = t.welcome()
-- Send to player...
end)For faster development, use watch mode to auto-rebuild on file changes:
roblox-slang build --watchNow when you edit translation files, the Luau code is automatically regenerated.
Check for missing translations or unused keys:
roblox-slang validateThis will report:
- Missing translations (keys in base locale but not in others)
- Unused keys (keys defined but never used in code)
- Conflicts (duplicate keys)
- Configuration Guide - Learn all configuration options including localization modes
- Pluralization - Handle plural forms correctly
- String Interpolation - Advanced parameter usage
- Roblox Cloud Integration - Upload to Roblox Cloud for access to Roblox features
- Rojo Integration - Use with Rojo for automatic file syncing
NEW in v2.0.2: Roblox Slang supports three localization modes:
Best for most games. Translations are embedded directly in the generated code.
Pros:
- No cloud dependency
- Works offline
- Fastest performance
- Simple setup
Cons:
- No Automatic Text Capture
- No automatic translation
- Manual translation management
When to use: Single-player games, offline games, or when you want full control over translations.
Uses Roblox Cloud LocalizationService exclusively.
Pros:
- Automatic Text Capture (ATC)
- Automatic translation via Roblox AI
- Translator Portal collaboration
- Analytics via Roblox Dashboard
Cons:
- Requires cloud setup
- Requires uploading translations
- Depends on LocalizationService availability
When to use: Multiplayer games that need automatic translation or want to use Roblox's translation ecosystem.
Best of both worlds: tries cloud first, falls back to embedded.
Pros:
- Cloud features when available
- Embedded fallback for reliability
- Graceful degradation
- Works in Studio and production
Cons:
- Slightly larger generated file size
- More complex setup
When to use: Games transitioning from embedded to cloud, or games that need offline support with cloud benefits.
Solution: Make sure the toolchain manager added the binary to your PATH. Try:
# For Rokit
rokit list
# For Aftman
aftman list
# For Foreman
foreman listSolution: Make sure you're in the project directory with slang-roblox.yaml. Run:
ls -la slang-roblox.yamlSolution: Check that translation files exist in the input_directory specified in config:
ls -la translations/- GitHub Issues - Report bugs or request features