Part 4 · Settings and reference / 4.2

System settings and language

The F2 page has exactly two entries: key bindings and interface language. This chapter explains how the language is chosen and shows how to add one of your own — without touching a line of Rust.

Reading time about 8 min Audience Everyone Prerequisites 4.1 Version v1.0 ・ 2026-08-26
4.2.1

The system settings page

Erya's entire configuration screen, and it has two entries.

爾雅 Erya │ System settings
↑/↓ Field ←/→ Choose E Edit keys Enter Apply Esc Cancel
Key bindings: ◀ Erya Terminal Safe ▶ ▶ Interface language: ◀ English (en) ▶
Erya Terminal Safe │ English
Choose with the arrow keys; Enter applies to every tab
KeyWhat it does
F2Opens system settings
↑ ↓Moves between “Key bindings” and “Interface language”. The selected row is highlighted and marked ▶.
← →Changes the value, wrapping at the ends.
EOpens the keymap editor (see 4.1.4)
EnterApplies and returns to editing
EscCancels; nothing changes

The status bar shows the combination currently selected (profile │ language), so you can check before pressing Enter.

4.2.2

What it applies to, and when

The moment you press Enter, every tab changes.

  • The message row confirms: “Applied settings: Erya Classic / English”.
  • Every open tab is affected at once; nothing has to be reopened.
  • The hint bar, status bar, and F1 help switch to the new language and the new keys immediately.
These settings are not remembered

System settings apply to this run only; Erya writes nothing to any configuration file. The next start is back to the defaults. To make a choice permanent:

  • Key bindings → the platform default path, or ERYA_KEYMAP (see 4.1.7).
  • Interface language → the ERYA_LANG environment variable (see 4.2.4).
4.2.3

How the interface language is chosen

Four environment variables are consulted in order; the first with a value wins.

ERYA_LANG Erya's own, first LC_ALL LC_MESSAGES LANG 正體中文 the fallback Codes are normalised before matching: en_GB.UTF-8, en-GB, and en all reach English With no match at all, the interface falls back to Traditional Chinese
Figure 4.2.1 Most people need to set nothing: Erya follows whatever LANG already says.
4.2.4

Setting ERYA_LANG

For changing Erya alone, without touching your system locale.

CommandResult
ERYA_LANG=en erya report.txtEnglish, this once
ERYA_LANG=ja eryaJapanese
ERYA_LANG=zh-TW eryaTraditional Chinese
ERYA_LANG=zh-CN eryaSimplified Chinese
erya --languagesLists the languages actually present, one per line as “codeTabname”

To make it permanent, add export ERYA_LANG=en to ~/.zshrc or ~/.bashrc; on Windows, add it to your user environment variables.

Run --languages if you are unsure of a code

Its first column is exactly what goes into ERYA_LANG, and languages you added yourself appear there too (see 4.2.6).

4.2.5

Where the translations live

Four languages are compiled in; the locales/ directory overrides and extends them.

Built in (inside the executable)

Traditional Chinese, Simplified Chinese, English, Japanese. Delete locales/ entirely and these four still work.

On disk (override and extend)

Read from locales/ by default; point ERYA_LOCALES_DIR elsewhere if you prefer.

A translation on disk with the same code takes precedence over the built-in one, so you can also use it to reword a few strings.

The file structure is straightforward:

SectionContents
[language]code (what ERYA_LANG uses) and name (shown by --languages and in system settings)
[messages]Every message on screen. Some contain placeholders such as {name} or {count}, which must be kept.
[key_help]The one-line description of each action in F1 help.
4.2.6

Adding your own language

Copy a file, change two fields, translate. No Rust involved.

  1. Copy an existing translation, for example cp locales/en.toml locales/fr.toml.
  2. Edit [language]: code = "fr", name = "Français".
  3. Translate [messages] and [key_help], keeping every {} placeholder.
  4. Check it: erya --languages should list fr Français.
  5. Use it: ERYA_LANG=fr erya, or pick it from the F2 list.
You do not have to finish it in one sitting

A partial translation works: anything missing falls back to Traditional Chinese (see 4.2.7). Translate the few dozen strings you see most often and fill in the rest later.

4.2.7

The fallback for missing strings

Always Traditional Chinese; never a blank.

  • A key missing from your translation → the Traditional Chinese string.
  • A key missing from Traditional Chinese as well (which should not happen) → the key name itself, e.g. clipboard_empty.
  • A language code that does not exist → the whole interface in Traditional Chinese.
Why Chinese

Erya is an editor written for CJK documents; Traditional Chinese is its native language and everything else is translated from it. So a line of Chinese appearing in an otherwise English interface almost always means an untranslated string.

4.2.8

Common problems

Six situations around settings and languages.

SymptomCause and fix
The setting reverted after a restartSystem settings apply to one run. Use an environment variable or config file (4.2.2).
The interface is in the wrong languageCheck the order: ERYA_LANG, LC_ALL, LC_MESSAGES, LANG (4.2.3).
ERYA_LANG seems ignoredThe code is misspelled, and an unknown code falls back. Check with --languages (4.2.4).
Your translation is not in the listThe file is not in the directory Erya reads. Set ERYA_LOCALES_DIR (4.2.5).
Chinese appears among English messagesThose strings are untranslated and fell back (4.2.7).
A message contains a literal {name}A placeholder was renamed or removed during translation. Restore the original {} name (4.2.5).