
Instructions for creating translations for MoI


Translating the Program UI
--------------------------------------

All the text displayed by MoI’s user interface comes from a text file named EnglishStrings.txt, located in the \ui subfolder underneath MoI’s main installation folder.

There can be multiple Strings.txt files installed in the \ui subfolder – there is a setting in MoI under Options > Language, which lets you switch at runtime between different languages.

To make a new translation, copy EnglishStrings.txt to a new file.
 
The copied file’s file name should end in “Strings.txt”, with the start of the file name being the language name. So for instance you could copy the file and name it FrenchStrings.txt – then when you start up MoI you should see an option for “French” in Options > Language, which you can choose to make MoI use this string table.

It is not necessary for MoI’s program code to be recompiled to use a new language, just having a new string table file present in the \ui folder will make a new language choice available.

The string table file itself is made up of a bunch of lines that each have an id=value pair. To do a translation, you replace the text on the right-side of the equal sign. Do not edit the id part to the left of the equal sign. There should be no spaces around the equal.

Lines that begin with a semi-colon (;) are comments.

You may want to save your string table file as a Unicode text file. To do this use Windows notepad.exe and do a SaveAs and set Encoding: to be Unicode. The string table file can only be either an ANSI or Unicode (UTF-16 only) text file.

It is possible to leave out some entries from your string table file – any ids not found in your string table file will be read from the EnglishStrings.txt file instead.



Translating the help file documentation
---------------------------------------------------

MoI’s help file is composed of several HTML files:

moi_help.htm            :   Help start page / table of contents
moi_introduction.htm :   Overview of basic operation and concepts
moi_commandreference.htm : Reference section that holds details on each command individually

The above 3 files are installed on to a user’s hard drive in a regular MoI installation.

There is also another tutorials.htm file that is an online web page – it is not stored locally since the videos would increase the download size by quite a bit.


The moi_help.htm and moi_introduction.htm files are pretty basic HTML files without very much formatting. To translate these files, just edit the HTML directly, change the links to point to your own e-mail address or web site if you want.

When you are done editing the files, they should be stored as a new HTML file with the language name added to the end, for example moi_help_French.htm, moi_introduction_French.htm, moi_command_reference_French.htm  – this allows for multiple help file languages to be installed at once, and also MoI will look for the language file that matches the current language setting when the user presses F1 or clicks Help.


Translating the tutorials page is more difficult, since the tutorial videos themselves have an English audio track on them. To translate these you will need to contact me at moi@moi3d.com to get a copy of the original video project files which are created using Camtasia 5 (they are pretty large, I may need to mail you a CD with them), and then you can replace the audio track with a translated version. After that you will also need to make a new tutorials page on your own web server and make your translated table of contents page link to that page instead of the regular English tutorials page. Some translations will probably want to just leave this part of the docs in English, at least initially.


The moi_commandreference.htm file has more formatting to it than the others, and was originally created from an XML file that is then translated into HTML with formatting applied.

For this file you can choose to edit the HTML file directly, or you can edit the XML file and rebuild the HTML output. Editing the XML and regenerating the HTML will make it easier to keep the document to have the same kind of formatting as the original docs. If you edit the HTML directly in a word processor, it can easily add extra spaces and re-arrange some stuff.

The XML can be edited in a text editor like notepad (maybe try notepad2) or also I think that Word 2003 or 2007 can edit an XML file as well. I personally used Visual C++ to edit it.

The XML file should be saved in UTF-8 encoding.

To transform the XML into HTML, go to a command prompt, cd into the directory for these files, and run the Build.cmd batch file. This will read in the moi_command_reference.xml file, and create a new moi_command_reference.htm file. Any pre-existing .htm file will be overwritten.

To see the results of any changes you make to the XML file, it is not necessary to run Build.cmd all the time, you can load the XML file directly into a web browser like IE or Firefox, and the web browser will apply the transform automatically. So you can keep the browser open, and after you save any changes to the XML file, just push reload on the browser to see the changes. This is a good method to use because the browser will also warn you if there are any mis-matched tags (like a starting <p> without an ending </p>) and
tell you the line number where the problem is at. You can modify any of the stuff inside <content></content> such as removing <p></p> paragraphs, adding new ones, etc... But for tags with content inside them like <p> there must be a matching closing </p> - HTML is not normally so strict about that, but when structured in an XML file the tags must be matching.
You can add a <br/> to add in any line breaks, and it is also possible to use <div></div> which is similar to <p></p> but does not put an extra blank line below it.


I tried in general to avoid putting text inside images, but there were a few places where it was hard for me to avoid it - there is one diagram in the mesh options, and also a screenshot of the mesh dialog there as well, one for the construction line menu. There are also a few images that have text labels visible in them for stuff like object snaps. I'm not sure if it is really necessary to worry about the little snap labels though.

If you want to replace any screenshot, add a new image with the language name at the end (like meshing1_french.jpg), so that multiple ones can be installed side by side.



Installation / Setup
------------------------

The one part that does need rebuilding is the installer – once you have all those files translated, you will need to send them to me if you want to have a new installer that incorporates them all in one install. I can also change the default language to be your language instead of English. There may also be one additional string table to translate for the installer, if there is not already a translation available for the installer messages. I’m using InnoSetup5 which has quite a few translations available for it already though.



Please e-mail me if you have any questions:  Michael Gibson, moi@moi3d.com

     - Michael

