Changes between Initial Version and Version 1 of Development/Translations


Ignore:
Timestamp:
09/24/09 20:37:36 (10 years ago)
Author:
ibboard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/Translations

    v1 v1  
     1[[PageOutline(2-5)]]
     2= Translating WarFoundry =
     3
     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.
     5
     6== Translation definitions ==
     7
     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:
     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"
     12lang="en">
     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        ...
     20</translations>
     21}}}
     22A 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"
     26lang="fr">
     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        ...
     34</translations>
     35}}}
     36Saving 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
     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:
     41{{{
     42<preference id="language" type="System.String">en</preference>
     43}}}
     44to
     45{{{
     46<preference id="language" type="System.String">fr</preference>
     47}}}
     48to use the French translations.
     49
     50== Translating data files ==
     51
     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.