Translating WarFoundry

From the start, WarFoundry has been designed as a translatable system. Although the lead developer, IBBoard, is British, he realised that a common problem with software from English-speaking nations is that it doesn't allow for translation. Since WarFoundry can speak many platforms (Windows, Linux and Mac OS X, to name but three) and many game systems, it only makes sense for it to speak many languages as well, especially when it is open-source. The following instructions detail how to translate the application.

Translation definitions

Translation definitions are stored in an XML file with the ".translation" extension. This file contains a simple list of mappings from translation IDs (which are used by the application) to translated strings. An example translation is included in each application for English translations. An excerpt is shown below:

<?xml version="1.0" encoding="ISO-8859-1"?>
<translations xmlns="http://ibboard.co.uk/translation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
lang="en">
	<translation id="menuFile">&amp;File</translation>
	<translation id="menuEdit">&amp;Edit</translation>
	<translation id="menuHelp">&amp;Help</translation>
	<translation id="miNewArmy">&amp;Create army</translation>
	<translation id="miOpenArmy">&amp;Open army</translation>
	<translation id="miExit">E&amp;xit</translation>
	...
</translations>

A translation of this in to French could look something like the following (apologies for any incorrect French!):

<?xml version="1.0" encoding="ISO-8859-1"?>
<translations xmlns="http://ibboard.co.uk/translation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
lang="fr">
	<translation id="menuFile">&amp;Fichier</translation>
	<translation id="menuEdit">&amp;Édition</translation>
	<translation id="menuHelp">&amp;Help</translation>
	<translation id="miNewArmy">&amp;Créer de l'armée</translation>
	<translation id="miOpenArmy">&amp;Ouvrir armée</translation>
	<translation id="miExit">&amp;Quitter</translation>
	...
</translations>

Saving the completed file and putting it in the "translations" folder under the application directory will make the translation available to the program.

Changing language

The WarFoundry applications don't currently have a preferences dialog and so although there are preferences, there isn't a pretty interface to change them through. If you want to change your language then open the "...Pref.xml" file (e.g. WarFoundryPref.xml) and change the "language" preference to the language abbreviation of your choice. If the French translation above was saved as "fr.translation" then the WinForms preference would be changed from:

<preference id="language" type="System.String">en</preference>

to

<preference id="language" type="System.String">fr</preference>

to use the French translations.

Translating data files

Currently, only UI translations are possible. If a translation of a data file (e.g. a game system or race definition) is required then the only solution at the moment is to duplicate the file and translate it. Future versions of the data files should support extensible translations.

Last modified 9 years ago Last modified on 09/24/09 20:37:36