Translation Builder
The Translation Builder is a small application for generating the message files used by Surpac using the master and work databases. This process takes place automatically when you are building the software, and so it is unlikely that this documentation will ever be needed by most users.
The Translation Manager uses several databases to store all the language and message information, however, it is not these files that Surpac itself uses to perform language translations when you are running the software in a language other than english. For this, it relies on a set of files that are installed in the <INSTALL DIRECTORY>/share/msg directory. These are named according to the language of the messages they contain. ("default" being used for english).
At the moment, these files are in unicode UTF-8 format, making it possible to store both plain ascii text, and more complex character sets like chinese and russian. (Russian used to use code page 1251)
The old messaging system used to define a numeric key for each message, which was then output to a set of C/C++ header files to allow the messages to be translated. This process has been changed slightly, with now a single header file being output, called AllEntries.h, but it still needs to be in the correct directory for inclusion in the build process.
Building the resource files from a Master Database only
To run the Translation Builder in this mode, the following command line can be used:
|
|
For Example:
C:\jdk1.3.1_04\bin\java.exe -classpath C:\master\dman\develop\share\java\ssiclient.jar com.surpac.mlt.TranslationBuilder C:\master\dman\src\include\TranslationMaster.uni
C:\master\dman\develop\share\msg C:\master\dman\develop\nt_i386\obj\include
|
Building the resource files with a Master and a Work file
This creates the resource files after a merge with the main and work modification files. To run the Translation Builder in this mode, the following command line can be used:
|
|
For Example:
|
|
Repairing the Master Translation Database
There is one other mode for the Translation Builder supplied for use by the Source Code Administrator for repairing inconsistencies in the master database that may be introduced during the merge process. When new entries are created in a work file, they are automatically assigned the next available unique numeric ID as they are merged into the master database during a build. When changes are made to different versions of the master database while adding entries to different branches in CVS, it is possible that the same key may be generated for different entries in different branches. It is therefore possible that when two branches are merged in CVS, the resulting master database could contain several keys with the same numeric ID. This can cause problems when Surpac tries to translate one of these entries.
The Translation Builder now checks for such conflicts during every Surpac build. If any are detected, the numeric IDs of the offending entries are automatically changed to something unique, and these new values are entered into the message files of the Surpac build. A brief warning is also output to stdout informing the user of the problem, also stating that this event should be reported to the Source Code Administrator. Note: No changes are made to the work or master database files during this process.
Once informed of this problem the Source Code Administrator can manually invoke the check for conflicts and repair them using the following:
JAVA -classpath JAR com.surpac.mlt.TranslationBuilder -fix [MASTER DATABASE FILE]
|
This will find any conflicts as mentioned above, only this will commit any changes made by re-writing the master database. The updated version can then be made available via CVS.
For example:
C:\jdk1.3.1_04\bin\java.exe -classpath C:\master\dman\develop\share\java\ssiclient.jar com.surpac.mlt.TranslationBuilder -fix C:\master\dman\src\include\TranslationMaster.uni
|
Further technical information: