Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Adding a Language

4got ships with 62 locale files. To add a new language:

Steps

  1. Copy data/locales/en.kdl to data/locales/{code}.kdl where {code} is the ISO 639-1 language code (e.g. fr, de, zh).

  2. Translate every key. The format is key "translated value" — one per line.

  3. Do NOT include about_* keys in non-English locales. The about page renders in English only.

  4. RTL languages (ar, fa, he, ur, yi, dv) get automatic dir="rtl" on the HTML tag. No extra work needed.

  5. Restart the server or send SIGUSR1 to hot-reload.

File naming

Use standard ISO 639-1 codes. For regional variants, use underscore: pt_BR.kdl, zh_TW.kdl.

Testing

Set the language cookie manually: document.cookie = "language=fr; path=/; max-age=34560000" and refresh. Or use the language setting in /settings if it exists for your locale.