As an example, we'll explain how to translate XXE messages to French[4].
Use
→ to install the add-on called "Translate XMLmind XML Editor" then restart XMLmind XML Editor (XXE for short).After installing the add-on, the translatexxe command-line utility is found in the translate_xxe/
subdirectory of one of the two addon/
directories scanned by XXE during its startup.
Use translatexxe.bat
on Windows and the translatexxe
shell script on Linux and on the Mac.
Create a new translation from scratch:
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -m fr.txt
Or update an existing translation. The existing translation is either found in a message Jar (example: fr_translation.jar
) or in an add-on Zip (example: fr_translation.zip
, itself containing fr_translation/fr_translation.jar
and fr_translation/fr_translation.xxe_addon
):
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -m fr.txt \misc\fr_translation.jar
or:
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -m fr.txt \misc\fr_translation.zip
All the above commands generate a text file. If you intend to use a specialized translation editor[5] rather than a text editor, you may want to generate an XLIFF file. In such case, specify a message file having a "xlf
", "xliff
" or "xml
" extension. Example:
C:\Prog…\translate_xxe> translatexxe -l fr \ -m fr.xlf \misc\fr_translation.jar
Message file fr.txt
looks like this:
++++++++++com/xmlmind/guiutil/Messages.properties ################################################# ### ChooseFile --- openFile=Open File openFile= CF.overwriteFile=Overwrite existing file\n\ "{0}"? CF.overwriteFile= ----------com/xmlmind/guiutil/Messages.properties ++++++++++com/xmlmind/xml/dtd/Messages.properties invalidDefaultValue=default value "{0}" of attribute "{1}" of "{2}" is invalid: {3} invalidDefaultValue= ----------com/xmlmind/xml/dtd/Messages.properties
Beginning of first section: messages contained in the | |
The title of the section is underlined using the ' | |
A comment added by the author of the English messages. As a translator, you can ignore these comments. | |
The ID of the message is " | |
English text of the message having " | |
Placeholder for the French text of the message having " | |
End of first section. | |
Beginning of next section: messages contained in the |
Translate all the messages found the “recommended sections” (underlined section title). See Section 3, “How to correctly translate a message”.
++++++++++com/xmlmind/guiutil/Messages.properties ################################################# ### ChooseFile --- openFile=Open File openFile=Ouvrir Fichier CF.overwriteFile=Overwrite existing file\n\ "{0}"? CF.overwriteFile=Écraser le fichier existant\n\ "{0}"? ----------com/xmlmind/guiutil/Messages.properties ++++++++++com/xmlmind/xml/dtd/Messages.properties invalidDefaultValue=default value "{0}" of attribute "{1}" of "{2}" is invalid: {3} invalidDefaultValue= ----------com/xmlmind/xml/dtd/Messages.properties
In a text file, in addition to normal characters, it is possible to use the following escape sequences: '\n
' (newline), '\t
' (tab), '\u
' (where XXXX
XXXX
is the code of a Unicode character in 4-digit hexadecimal notation). '\u
' is especially useful because it's the only way to specify characters not supported by the encoding passed to the XXXX
-e
command-line option. Example: '\u2192
' (right arrow).
Test your translation by first converting the text file to a message Jar:
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -j ..\addon\fr_translation.jar fr.txt
Make sure that the message Jar is found inside one of the two addon/
directories scanned by XXE during its startup. Then start XXE, clear or disable its Quick Start cache[6] and restart XXE.
If, after restarting XXE, you don't see its user interface translated to the target language, then this means that the locale of your computer (example: en-US
) does not correspond to the target language (example: fr
). When this is the case, use → , General section, to change the locale used by XXE from "(default)" to the locale corresponding to the target language (example: "français").
Finally convert the text file to a ready-to-deploy add-on Zip:
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -p \misc\fr_translation.zip fr.txt
You may want to specify for the name of the author of the add-on using the -a
command-line option. A string starting with "mailto:
" (example: "mailto:jane@doe.name
") gets a special treatment. A string starting with "<html>
" and followed by well-formed, properly escaped, XHTML (example: "<html><a href='http://www.doe.name/'>Jane Doe & al.</a>
") also gets a special treatment. Otherwise, the string is understood to be plain text (example: "Jane Doe & al.
").
C:\Prog…\translate_xxe> translatexxe -l fr -e windows-1252 \ -a "mailto:jane@doe.name" -p \misc\fr_translation.zip fr.txt