LibreTranslate

Rust slang expansion

The dictionary that expands Rust-specific shorthand to a translatable phrase before sending to LibreTranslate.

LibreTranslate's models are general-purpose. They don't speak Rust. If you send them tc, they pass it through; if you send them m2, they output M-two; if you send them kos, they invent garbage.

So the !translate command runs a dictionary pass first, expanding every Rust-specific token to a full English phrase. The translation roundtrip then receives meaningful vocabulary.

Substitution rules

  • Whole-word match only. ak matches "ak" but not "naked".
  • Case-insensitive.
  • The substitution happens before language detection, so tc roof becomes tool cupboard roof before LT decides “this is English”.

The dictionary (selected)

Weapons & ammo

SlangExpanded
akAK rifle
bolty, boltbolt action rifle
lrLR-300 rifle
mp5MP5 submachine gun
thompson, tommyThompson submachine gun
m92M92 pistol
m249, m2M249 light machine gun
hmlmgHMLMG machine gun
dbdouble-barrel shotgun
pumppump shotgun
semisemi-automatic rifle
smgsubmachine gun
rocketrocket launcher
c4C4 explosive
satchsatchel charge

Structures & raiding

SlangExpanded
tctool cupboard
wbworkbench
bpblueprint
bagsleeping bag
armoured, armoredarmoured wall
sheetsheet metal wall
hqmhigh quality metal

Tactics & callouts

SlangExpanded
koskill on sight
nakedunarmed and unarmoured
roamroaming
proxynearby player
farmfarming resources
gathergathering resources
peekpeek out
pushpush forward
holdhold position
flankflank around

Adding to the dictionary

The dictionary lives in rustplus-api/src/lib/intel/translate.ts. Add a key/value, redeploy the API. There's no admin UI for this in v1 — on the roadmap.

Caveats

  • Some short slang collides with real words in other languages (ak is also Turkish for “flow”). The whole-word match avoids false positives inside compound words but the false-positive at standalone-word level is unavoidable. The cost — one slightly wrong English expansion — is much smaller than the cost of every callout going through untranslated.