Though ILWIS was in theory multilingual from the 2.0 version, it was hardly used. I believe there was a (partly?) Italian version and a partly Spanish version, but they never ended up in the release version and/or were maintained. In the 3.7 this for the first time changed. Thanks to the work of Robin Prest and the money from the Geonetcast project a french translation of the user interface could be made.
The work of Mr .Prest made me also realize that the existing translation system was cumbersome and difficult to maintain. Oh, it worked, the results are ok. But it is more work than needed and difficult to track changes. Furthermore I found is as a programmer also quite annoying. Basically I had to touch multiple files when adding a string in the code. So one of the goals for the 3.8 was a more comprehensive translation system.
From the GeontetCast project the clear whish was there to have a Spanish and Portugese translation. So it was reasonable to spend some time to make this easier
I had a few goals with the new translation system,
- The translator should have to touch as few files as possible.
- The programmer should have to touch as few files as possible
- Maintainance should be easy
- The translation files can be changed without needing the change anything in ILWIS.
- Men contain the texts of all the menus except for the operations menu. So when you translate ‘Men’ you will get a translation of all the menus. The men file consists of a number and a string. Each menu item is coupled to the number, and through the number it can find the string. This is a different organization than the ‘string_table’ file(see later) but there are technical reasons for that (never mind). When translating the file take care that the special signs (e.g. ‘&’) als end up in the translation. They have a meaning. The ‘Men’ file is not very large and can easily be translated
- Dsc ( short for description) is a direct companion of the ‘Men’ file. Basically it contains the description/short explanation of the menu commands that appear on the status-bar below ilwis windows. it is structure and numbering are identical to the Men file.
- The big translation table is the ‘String_Table’ file. it contains ‘the rest’. So all the forms, operation menu, windows etc.. The structure of this file is different. The file consist of a pair of strings separated by a ‘|’. For example “Invalid Map|Mapa Incorecto”. The software, internally, knows of the first english string and simply looks it up in the table constructed of this file to see if their is an (translated) alias. If so, great, it uses it. If not, it will use the internal english version. Note that when translating these texts it is very important to take over all the special symbols. Particual the ones marked with % ( e.g. %S, %i etc. These are, during execution, filled with internal values. So for example a string “Adding File %S” might become “Adding File MyMap” because that is something that was happening during execution.
This table is quite big, at the moment around 3700 entries. Not difficult to translate, simply a lot of work,
Robin says
Hi Martin,
I!ll try someday to update some of the new functions.
If I may add some comments, one the the hardest parts in translation ILWIS was finding where the function came from and what context was used for it : as you may guess, some sentences have a different meaning depending on where you use it.
As a translator, I would love the following :
1. Classify all strings by context, with the english word left, a “;”, then a space for translation. You could add a unique number at the beginning of each line to make sure (as in a database), the string line would be referenced correctly in the code and the old sentences never used.
Exemple of an old translation file
#CLASS ENTITY
1;Polyline;Polyligne
2;Vector;Vecteur
3;Point;Point
4;Line;Ligne
#MENU FILE
4;Open;Ouvrir
5;Save;Enregistrer
…(etc)
3789;Quit;Quitter
Exemple of an future translation file :
#CLASS ENTITY
1;Polyline;Polyligne
2;Vector;Vecteur
3;Point;Point
4;Line;Ligne
3790;Voxel;Pixel 3D
3791;Whatever;
#MENU FILE
4;Open;Ouvrir
5;Save;Enregistrer
….
3789;Quit;Quitter
As you see, the new translation file just adds new numbers after the last one used. The translator just needs to translate number 3791 and one can see the number 3790 has already been translated.
You could also imagine changing the interface, no problem, you just need to place the numbers right :
#MENU FILE
4;Open;Ouvrir
3792;Open as…;Ouvrir comme…
3793;Save as…;Enregistrer sous…
In the code, the strings refer to unique numbers the refer to unique translation.
It only requires for the translator to check if each menu if fully translated, even if he has to retranslate the same word a few times, but that’s not really a problem, because as I saif, some identical words may change sense in different contexts.
Thanks for your work,
Robin.
MartinSchouwenburg says
Classifying string by context is quite hard and error prone. You are right of course in theory but the discipline needed to add the metadata consistently, most likely will fail. Anyway there is a huge amount existing strings scattered around the code that doesnt have this data, tracking them down is huge task.
I agree with you that it would be nice.