Changes between Initial Version and Version 1 of Development/Translations

09/24/09 20:37:36 (10 years ago)



  • Development/Translations

    v1 v1  
     2= Translating WarFoundry =
     4From 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.
     6== Translation definitions ==
     8Translation 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:
     10<?xml version="1.0" encoding="ISO-8859-1"?>
     11<translations xmlns="" xmlns:xsi=""
     13        <translation id="menuFile">&amp;File</translation>
     14        <translation id="menuEdit">&amp;Edit</translation>
     15        <translation id="menuHelp">&amp;Help</translation>
     16        <translation id="miNewArmy">&amp;Create army</translation>
     17        <translation id="miOpenArmy">&amp;Open army</translation>
     18        <translation id="miExit">E&amp;xit</translation>
     19        ...
     22A translation of this in to French could look something like the following (apologies for any incorrect French!):
     24<?xml version="1.0" encoding="ISO-8859-1"?>
     25<translations xmlns="" xmlns:xsi=""
     27        <translation id="menuFile">&amp;Fichier</translation>
     28        <translation id="menuEdit">&amp;Édition</translation>
     29        <translation id="menuHelp">&amp;Help</translation>
     30        <translation id="miNewArmy">&amp;Créer de l'armée</translation>
     31        <translation id="miOpenArmy">&amp;Ouvrir armée</translation>
     32        <translation id="miExit">&amp;Quitter</translation>
     33        ...
     36Saving the completed file and putting it in the "translations" folder under the application directory will make the translation available to the program.
     38== Changing language ==
     40The 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:
     42<preference id="language" type="System.String">en</preference>
     46<preference id="language" type="System.String">fr</preference>
     48to use the French translations.
     50== Translating data files ==
     52Currently, 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.