Adding a Language
4got ships with 62 locale files. To add a new language:
Steps
-
Copy
data/locales/en.kdltodata/locales/{code}.kdlwhere{code}is the ISO 639-1 language code (e.g.fr,de,zh). -
Translate every key. The format is
key "translated value"— one per line. -
Do NOT include
about_*keys in non-English locales. The about page renders in English only. -
RTL languages (
ar,fa,he,ur,yi,dv) get automaticdir="rtl"on the HTML tag. No extra work needed. -
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.