| 1 | [[PageOutline(2-5)]] |
| 2 | = Translating WarFoundry = |
| 3 | |
| 4 | 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. |
| 5 | |
| 6 | == Translation definitions == |
| 7 | |
| 8 | 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 [browser:IBBoard.WarFoundry.GUI.WinForms/trunk/translations/en.translation English translations]. An excerpt is shown below: |
| 9 | {{{ |
| 10 | <?xml version="1.0" encoding="ISO-8859-1"?> |
| 11 | <translations xmlns="http://ibboard.co.uk/translation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 12 | lang="en"> |
| 13 | <translation id="menuFile">&File</translation> |
| 14 | <translation id="menuEdit">&Edit</translation> |
| 15 | <translation id="menuHelp">&Help</translation> |
| 16 | <translation id="miNewArmy">&Create army</translation> |
| 17 | <translation id="miOpenArmy">&Open army</translation> |
| 18 | <translation id="miExit">E&xit</translation> |
| 19 | ... |
| 20 | </translations> |
| 21 | }}} |
| 22 | A translation of this in to French could look something like the following (apologies for any incorrect French!): |
| 23 | {{{ |
| 24 | <?xml version="1.0" encoding="ISO-8859-1"?> |
| 25 | <translations xmlns="http://ibboard.co.uk/translation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 26 | lang="fr"> |
| 27 | <translation id="menuFile">&Fichier</translation> |
| 28 | <translation id="menuEdit">&Édition</translation> |
| 29 | <translation id="menuHelp">&Help</translation> |
| 30 | <translation id="miNewArmy">&Créer de l'armée</translation> |
| 31 | <translation id="miOpenArmy">&Ouvrir armée</translation> |
| 32 | <translation id="miExit">&Quitter</translation> |
| 33 | ... |
| 34 | </translations> |
| 35 | }}} |
| 36 | Saving the completed file and putting it in the "translations" folder under the application directory will make the translation available to the program. |
| 37 | |
| 38 | == Changing language == |
| 39 | |
| 40 | 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. [browser:IBBoard.WarFoundry.GUI.WinForms/trunk/WarFoundryPref.xml 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: |
| 41 | {{{ |
| 42 | <preference id="language" type="System.String">en</preference> |
| 43 | }}} |
| 44 | to |
| 45 | {{{ |
| 46 | <preference id="language" type="System.String">fr</preference> |
| 47 | }}} |
| 48 | to use the French translations. |
| 49 | |
| 50 | == Translating data files == |
| 51 | |
| 52 | 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. |