This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
- The latest Hedgewars localization files
- A text editor like Notepad++, Geany, Vim, etc.
- Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
Getting the localization files
To get the Hedgewars localization files there are 4 possible ways.
- A. Clone the Hedgewars source repository.
- B. Download the latest Hedgewars source code.
- C. Find the localization files in your current Hedgewars installation.
- D. Download only the specific files to be translated.
The A is maybe the most convenient way to include the translations in the next Hedgewars release as you can easily produce a patch to provide it to the Hedgewars developers. Note that a fast internet connection is desired as you probably will clone the whole game sources. The other advantage of this way is that it can be used to translate the latest game version that is going to be released.
The B way is a lot like the A way but more limited.
The C is probably the fastest way and the more convenient for the translator.
However, it has the limitation that one can only translate the most recent Hedgewars release (the one currently installed) and not the version that is going to be released.
The D way is to download the desired files from here.
Above I am going to discuss the C way (Find the localization files in your current Hedgewars installation).
Finding the localization files
In GNU/Linux you have to look into
/path-to-Hedgewars/Data/Locale where path-to-Hedgewars
is the path to your Hedgewars installation.
In Windows you have to look into
where path-to-Hedgewars is the path to your Hedgewars installation.
For example in an Arch Linux box the path is
In a Windows 8 box the path is
C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale
Here is a list of the different localization files of the English language that you should use as your translation reference/template as it should be the most accurate and up to date. The file locations are relative to the top directory of the Hedgewars source code. You can edit all these files with a text editor, but for some files special editors are available.
Engine (in-game stuff)
—This contains the core in-game strings, such as the mission panel, the messages at the top, ammo names and descriptions
—Strings used by Lua scripts, which includes campaigns, missions and game styles
Frontend (main menu)
—Contains most strings of the frontend and you can edit it with Qt Linguist
—This is the mission description strings
—This is the campaign description strings
—This contains the tips shown in the main menu. This file is not in XML format!
Mission map descriptions
The map selection shows brief descriptions for mission maps below the preview image. Those can be translated and you find those texts in:
>” with the name of any mission map. To translate these, add a line of the format
(e.g. “en=This is an example.” for English). Since version 0.9.23, you must use the following special character sequences for new lines, commas and underscores:
| Written text || Is replaced by |
| New line |
| Comma |
| Underscore |
The following files are not used by Hedgewars itself, but they contain translatable metadata about Hedgewars:
—Desktop Entry file for the Hedgewars application
—Desktop Entry file for the Hedgewars engine for playing savegames and demos
—Do not translate! This file will be automatically generated from
when building Hedgewars
—Description of Hedgewars file types
Updating an existing translation
That is relatively easy. Just edit the existing file. You can edit every file with your favorite editor and the
file with Qt Linguist.
file doesn’t exist. The strings are hard coded in the code.
Creating a new translation
That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
file doesn’t exist. Use
instead as your template.
Here are 3 examples:
- For French copy
- For Spanish copy
- For Greek copy
Testing the translations
When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
If a translation is missing then the string is going to be displayed in English.
Note that you should restart the frondend for the language changes to take effect.
Sharing the translations
In order to share your translations with Hedgewars community there are 3 possible ways:
- Give them the files and tell them where to place them. Of course this is the less convenient way but it is maybe a good approach to let other players double-check your translations
- Talk with a Hedgewars developer in order to include it in DLC
- Talk with a Hedgewars developer in order to include it in the next Hedgewars release
Things to have in mind
If you are going to make a translation for a next Hedgewars release strings may not be frozen yet and change before the release. Better ask in irc in cases like that.