Skip to content

Localization (i18n)

The debugger's user-facing messages (runtime errors and the adapter's replies to the editor) live in one place, shared by the plugin and the adapter:

Where What
crates/protocol/src/messages/mod.rs Locale, MsgKey (the keys) and the routing (msg/format)
crates/protocol/src/messages/langs/<code>.rs one match table per language: get(MsgKey) -> &'static str

The texts are templates with positional {} markers, filled in by messages::format(locale, key, &[args]). The language comes from the editor (the locale argument of initialize, in the adapter; the PAWNPRO_DBG_LOCALE env var, in the plugin) and is resolved by prefix (Locale::from_tag); an unknown one falls back to English.

There are 11 message keys (5 runtime errors + 6 from the adapter). Each language's match on MsgKey is exhaustive — a missing key does not compile. That is why a language marked ✅ necessarily covers all 11.

Legend: ✅ complete · 🟡 partial · ⬜ missing.

Coverage goal: at least 50 languages. The order prioritizes historical relevance in the SA-MP / open.mp community. Today there are 5 implemented.

Status

# Language Code Status
1 English (source) en
2 Portuguese (BR) pt-BR
3 Spanish es
4 Russian ru
5 Romanian ro
6 German de
7 French fr
8 Italian it
9 Polish pl
10 Turkish tr
11 Dutch nl
12 Ukrainian uk
13 Chinese (Simpl.) zh-CN
14 Chinese (Trad.) zh-TW
15 Indonesian id
16 Arabic ar
17 Portuguese (PT) pt-PT
18 Hungarian hu
19 Czech cs
20 Serbian sr
21 Bulgarian bg
22 Greek el
23 Swedish sv
24 Lithuanian lt
25 Croatian hr
26 Slovak sk
27 Hebrew he
28 Thai th
29 Vietnamese vi
30 Persian fa
31 Japanese ja
32 Korean ko
33 Finnish fi
34 Danish da
35 Norwegian nb
36 Hindi hi
37 Bengali bn
38 Filipino fil
39 Malay ms
40 Latvian lv
41 Estonian et
42 Slovenian sl
43 Belarusian be
44 Macedonian mk
45 Albanian sq
46 Bosnian bs
47 Catalan ca
48 Azerbaijani az
49 Kazakh kk
50 Georgian ka

Adding a language

  1. Create crates/protocol/src/messages/langs/<code>.rs with pub fn get(key: MsgKey) -> &'static str covering every MsgKey (keeping the {} markers in the same logical position).
  2. Register the module in langs/mod.rs (pub mod <code>;).
  3. Add the variant to the Locale enum, to Locale::from_tag (by prefix) and to the match in messages::msg.
  4. Mark it ✅ in this table.