Languages¶
RustGIS's interface is available in 22 languages:
| Language | Code | Language | Code | |
|---|---|---|---|---|
| English | en |
Русский (Russian) | ru |
|
| Deutsch (German) | de |
Türkçe (Turkish) | tr |
|
| Español (Spanish) | es |
Azərbaycanca (Azerbaijani) | az |
|
| Français (French) | fr |
Bahasa Indonesia (Indonesian) | id |
|
| Italiano (Italian) | it |
Tiếng Việt (Vietnamese) | vi |
|
| Nederlands (Dutch) | nl |
简体中文 (Chinese, Simplified) | zh |
|
| Polski (Polish) | pl |
日本語 (Japanese) | ja |
|
| Português (Portuguese) | pt |
한국어 (Korean) | ko |
|
| ქართული (Georgian) | ka |
বাংলা (Bengali) | bn |
|
| فارسی (Persian) | fa |
Ελληνικά (Greek) | el |
|
| ພາສາລາວ (Lao) | lo |
繁體中文(臺灣)(Chinese, Traditional, Taiwan) | zh-tw |
Choosing a language¶
By default RustGIS follows the first supported language in your system's preferences (your
browser's on the web) and falls back to English. Taiwan's locale (zh-TW) and zh-Hant get the
Traditional Chinese (Taiwan) catalog, mainland Chinese locales the Simplified one; neither ever
shows the other's text. To choose a language yourself, open
Settings › Language. The choice is remembered in prefs.json in the desktop app's settings
folder, or in browser storage on the web. When following the system language, you can override
its detection for one desktop run with RUSTGIS_LANGUAGE:
RUSTGIS_LANGUAGE=de cargo run --release -p rustgis
Only the interface is translated. Your data, layer and field names, command ids and the command line stay as they are, so scripts work in every language.
Chinese, Japanese and Korean need a CJK font. RustGIS looks for installed regional faces on Windows, macOS, Linux, Android and iOS; a font collection's face index and readable outlines are checked. Android's system/manufacturer folders and iOS's font subfolders are searched. Some iOS fonts do not expose outlines that RustGIS can read, even though native system widgets can draw them.
When an installed face is absent or lacks the selected language's letters, the app downloads a
verified fallback from assets.rustgis.app: Noto Sans SC/TC/JP/KR for CJK, Vazirmatn for Persian,
Noto Sans Bengali or Noto Sans Lao, and Noto Sans for extended Latin (Azerbaijani and Vietnamese).
Native apps keep these fonts in their cache for offline restarts. The browser uses its normal
HTTP cache. Fonts are not bundled into the application.
A language becomes active only after the current regular, semibold and monospace fonts cover its catalog's letters and combining marks, plus punctuation and numerals in its Arabic, Bengali, Lao or CJK script. While a face is loading, or if it fails, the previous readable language stays active (English on first launch). A notice explains a failure; choosing the language again retries it. An unreadable or wrong-script download is rejected before it enters the font cache.
On native apps, text in tables and other widgets can request a fallback regardless of the interface language. The browser can draw UI-only missing glyphs through its canvas fallback; map rendering and exports request the shared font files on every platform. Map measurement, image/vector/PDF exports and character markers share those fallback faces; late downloads refresh their cached widths and marker outlines. Vector-tile labels also request missing fonts rather than silently preventing the download by filtering their text. Until a font arrives, exported text can be missing; output notices identify unavailable glyphs and skipped label lines. Scripts outside the supported set can still need an installed named font. Font coverage does not by itself add support for a new language or its text shaping.
Persian's fallback must include both Arabic-script and Latin letters so mixed-direction UI text stays in one shaping run. Bengali and Lao fallbacks can be script-only: Latin text is drawn by the preceding interface font. See the shaping limitations below for exported complex scripts.
Translating¶
Each non-English language is a UTF-8 catalog of English<TAB>Translation lines in
crates/ui-egui/src/i18n/<code>.tsv. English is the source language and has no catalog. Blank lines
and lines beginning with # are ignored. Within either field, \n, \t and \\ represent a
line break, tab and backslash. A missing entry shows in English, so translations can grow one
line at a time, and corrections from native speakers are welcome.
The Traditional Chinese catalog uses Taiwan's wording, with GIS terms after the glossary of the National Academy for Educational Research (國家教育研究院樂詞網, 地理資訊系統名詞): 圖徵 (feature), 網格 (raster), 環域 (buffer), 套疊 (overlay), 坐標 (coordinate). In a table 欄 is a column and 列 a row, the other way round from Simplified Chinese.
Pull requests can leave new strings out of the catalogs: the maintainer translates them before
each release. To translate a new string, add a line with the exact English text, a tab, and the
translation. Keep {placeholders} such as {n} or {name} (they may move), keep the line break
(\n) in two-line ribbon labels, and leave product, format and key names (RustGIS, GeoJSON, CSV,
Ctrl…) in English. To add a language, add its catalog and a row in LANGUAGES in
crates/ui-egui/src/i18n/mod.rs. The i18n tests check catalog format and placeholders, and
require translations for some established interface strings:
cargo test -p rustgis-ui-egui i18n
Context for ambiguous words¶
Existing two-column catalogs keep their meaning. For a word used in different senses, an
optional first column gives a stable context: Context<TAB>English<TAB>Translation. An empty
context is the same as an ordinary two-column row. For example, a German catalog can contain:
Open Öffnen
file-state Open Offen
Use tl!("Open", context = "file-state") at the call site. tl_raw! accepts the same context
for fragments, and
i18n::fmt_context("file-state", "{n} open", &[("n", &count.to_string())]) formats a
contextual message. Contexts describe the sense of a word, not a translated label. When a
contextual entry is missing, lookup falls back to the ordinary translation, then to English.
Plugin catalogs keep their existing format and provide the ordinary fallback.
Each context and English key may appear only once, including after unescaping. The catalog tests check contextual placeholders too; malformed and duplicate rows report their line number.
Persian text uses the toolkit's script shaping, with Latin runs and brackets adjusted by
crates/ui-egui/src/i18n/rtl.rs. Long paragraphs are broken into lines before drawing. Panes
and widgets retain their left-to-right layout. Arabic, Hebrew, Hindi and Thai are not included
in the language picker.
The CPU image/vector/PDF renderer currently positions individual glyphs with advances and kerning; it does not yet share the UI's complex-script shaping and bidirectional layout. Font fallback preserves glyphs there, but Persian joining and Bengali/Lao mark placement can still differ from the UI. A shared shaping implementation is separate from discovering or downloading fonts.