13 languages with full Unicode support, CJK/emoji rendering, and automatic locale detection — compiled directly into the C binary.
Scorpiox Code ships with 13 languages compiled into a single static binary. No external locale files, no resource bundles, no runtime dependencies. The CLI auto-detects your system locale via LANG, LC_ALL, and LC_CTYPE environment variables. The web interface parses Accept-Language headers. Fallback is always English.
| Code | Language | Native Name | Direction |
|---|---|---|---|
en |
English | English | LTR |
ar |
Arabic | العربية RTL | RTL |
de |
German | Deutsch | LTR |
es |
Spanish | Español | LTR |
fr |
French | Français | LTR |
it |
Italian | Italiano | LTR |
ja |
Japanese | 日本語 | LTR |
ko |
Korean | 한국어 | LTR |
pt |
Portuguese | Português | LTR |
ru |
Russian | Русский | LTR |
tr |
Turkish | Türkçe | LTR |
zh-CN |
Chinese (Simplified) | 简体中文 | LTR |
zh-TW |
Chinese (Traditional) | 繁體中文 | LTR |
The TUI handles full UTF-8 including CJK wide characters and emoji. Custom C functions compute display widths correctly — essential for terminal column alignment when mixing Latin, CJK, and emoji glyphs.
sx_term_utf8_len()
Returns byte length of a single UTF-8 codepoint from its lead byte
sx_term_utf8_width()
Returns display width (1 or 2) of a UTF-8 codepoint — 2 for CJK/emoji
sx_term_str_width()
Returns total display width of a UTF-8 string, summing per-character widths
sx_sanitize_utf8()
Strips invalid UTF-8 sequences, replacing with safe fallback characters
utf8_to_wide()
Converts UTF-8 byte string to wide-character (wchar_t) string
wide_to_utf8()
Converts wide-character string back to UTF-8 byte string
The CLI initializes with setlocale(LC_ALL, "") to respect system settings. It then checks LANG, LC_ALL, and LC_CTYPE environment variables to select the appropriate language. The web server reads the Accept-Language HTTP header and negotiates the best match from the 13 supported languages.
/* CLI locale initialization — every entry point */
setlocale(LC_ALL, "");
/* Environment variables checked (in priority order) */
LC_ALL → overrides everything
LC_CTYPE → character classification
LANG → default fallback locale
/* Web server: HTTP header negotiation */
Accept-Language: ja,en;q=0.9,zh-CN;q=0.8
→ resolved: ja (Japanese)
Locale Detection — 14 source files use setlocale():
sx.cscorpiox-askuserquestion.cscorpiox-bash.cscorpiox-config.cscorpiox-conv.cscorpiox-debug.cscorpiox-logger.cscorpiox-printlogs.cscorpiox-pwsh.cscorpiox-server.cscorpiox-systemprompt.cscorpiox-tmux.cscorpiox-transcript.cscorpiox-unshare.cThe website uses a Python T dictionary pattern: T[key][lang]. Each page defines translation keys for all 13 languages. The detect_lang() function checks ?lang= query params first, then parses Accept-Language headers. All 176 translation keys across 16 page files maintain 100% coverage for every language.
# Python T dictionary pattern (every .py page)
T = {
'page_title': {
'en': 'Internationalization — SCORPIOX CODE',
'ja': '国際化 — SCORPIOX CODE',
'ar': 'التدويل — SCORPIOX CODE',
# ... 13 languages total
},
}
# Language detection
def detect_lang(environ):
# 1. Check ?lang= query parameter
# 2. Parse Accept-Language header
# 3. Fallback to 'en'
# scorpiox-env.txt — force a specific language
LANG=ja_JP.UTF-8
# Or set via environment before launching
$ export LANG=de_DE.UTF-8
$ scorpiox-code
# Web: use ?lang= query parameter
https://code.scorpiox.net/?lang=ko
https://code.scorpiox.net/?lang=zh-CN
https://code.scorpiox.net/?lang=ar
Unicode handling is implemented across 27 source files. Key implementation files include sx_term.c/h for terminal width calculations, sxui_input.c for wide-character input, and sx_html_strip.c for UTF-8 safe HTML parsing.
sx_term.csx_term.hsxui_input.csxui_input.hsx_html_strip.csx_json_yy.csx_json_yy.hsx_api.csx_http_wasm.csx_agent_tools_wasm.csx_fs_wasm.csx_wsl.csx.csx_dll.hsx_statusbar.csxmail_imap.csxmail_queue.csxmux_vt.csxmux_vt.hscorpiox-askuserquestion.cscorpiox-bash.cscorpiox-config.cscorpiox-email.cscorpiox-tmux.cscorpiox-traffic.cscorpiox-transcript.cscorpiox-unshare.c