4.2 KiB
How To Translate Draugnorak (Beginner Guide)
This guide is for first-time translators. You do not need to know programming.
What You Are Editing
Draugnorak stores text in translation files inside the lang/ folder.
Important files:
lang/en.template.ini-> a clean template you copy from.lang/en.ini-> English source text used by the game as fallback.lang/<your-language-code>.ini-> your translation file.
Example language codes:
esfor Spanishfrfor Frenchdefor Germanpt-BRfor Brazilian Portuguese
Before You Start
You need:
- A plain text editor (VS Code, Notepad++, Kate, etc.).
- This project folder on your machine.
- Basic comfort editing text files.
Step 1: Make Your Translation File
- Open the
langfolder. - Copy
en.template.ini. - Rename the copy to your language code, for example:
es.ini
You now have a file like lang/es.ini.
Step 2: Fill In Language Metadata
At the top of the file, find:
[meta]
code=en
name=English
native_name=English
Change these values for your language.
Example for Spanish:
[meta]
code=es
name=Spanish
native_name=Espanol
Notes:
codeshould match your filename (es.ini->code=es).namecan be in English.native_nameshould be in your own language (what speakers call it).
Step 3: Translate Only the Right Side
Every line is key=value.
Example:
msg.528fb1c4e5fb=New Game
You only translate the value after =:
msg.528fb1c4e5fb=Nuevo juego
Do NOT change:
- the key (
msg.528fb1c4e5fb) - section names like
[messages] - file structure
Step 4: Keep Placeholders Exactly As Written
Some messages contain placeholders like:
{arg1}{arg2}{language}{count}
Example:
system.language.selected=Language set to {language}.
Good translation:
system.language.selected=Idioma configurado en {language}.
Rules:
- Keep placeholder names exactly the same.
- You can move them in the sentence.
- Do not remove them.
- Do not rename them.
Bad examples:
... {lang}(wrong name)- missing placeholder entirely
Step 5: Keep Escapes Intact
Some values may contain escaped characters:
\n= new line\t= tab
If you see these, keep them unless you know exactly why to change them.
Step 6: Save as UTF-8
Use UTF-8 encoding so accented and non-Latin characters are stored correctly.
Most modern editors use UTF-8 by default.
Step 7: Validate Your Translation
From the project root, run:
python3 scripts/validate_i18n_catalog.py
What this checks:
- missing keys
- extra keys
- placeholder mismatches
If it prints OK, your file structure is valid.
If it prints FAIL, read the listed errors and fix them.
Step 8: Test In-Game
On first launch, the game asks for language selection if no saved language preference exists. Choose your language and check menus/messages.
If language was already saved before, you may need to remove or edit the saved preference file so first-run selection appears again.
(Preference is stored in draugnorak.dat under the appdata config directory.)
Common Mistakes
- Editing keys instead of values.
- Deleting
{arg1}placeholders. - Renaming section headers.
- Saving in a non-UTF-8 encoding.
- Forgetting to run validator script.
Translation Style Tips
- Prefer clear, simple text over literal word-for-word translation.
- Keep gameplay warnings short and urgent.
- Keep menu labels concise.
- Keep terminology consistent (same item name everywhere).
Example Mini Translation
Original:
msg.528fb1c4e5fb=New Game
msg.802aa6576577=Load Game
msg.f83b6fe3aebf=Exit
Spanish example:
msg.528fb1c4e5fb=Nuevo juego
msg.802aa6576577=Cargar partida
msg.f83b6fe3aebf=Salir
If You Are Unsure About a Line
If one sentence is unclear:
- Leave it in English for now.
- Add a comment above it using
;. - Continue the rest.
Example:
; Need context: is this shown during combat or menu?
msg.abcdef123456=Original English text
Submitting Your Translation
Share these files:
- Your language file, for example
lang/es.ini. - Optional notes for unclear lines.
That is all you need to contribute a translation.