How to create a translation bundle
1. Tools and Principles
A translation bundle is a set of (or sometimes only one) java properties files that define a token and a translation for one language.
One translation bundle per language is required. The English translation bundle is the default language bundle.
Whenever the program tries to switch to a language for which it cannot find a translation bundle it will revert to the default (English) bundle.
Java properties use Unicode characters which can be difficult to handle on some operating systems. The translation editor tool helps to
facilitate the process of translation bundle creation. It is a very simple Java program that loads/saves a translation bundle, provides
an editor and an error check. You can run it by double clicking TranslationEditor.jar (if your OS supports this) or launch it with the command
java -jar TranslationEditor.jar
If you are interested in providing a translation bundle for a new language send me an email and I will prepare an empty translation bundle for your language.
2. Getting started
The translation bundle comes as a zip-file that contains all required files. Do not unpack it. You can load it in the Translation Editor
via the File->Open menu item. When loaded you will see a table with three columns:
- Token: The token that is used to identify the word or phrase. You cannot change it. Just for your information.
- Default: The translation provided by the default (English) translation bundle. This explains the meaning of the entry.
- Your language: Your translation of the word or phrase.
You will also find several pages, one for each category of phrases.
3. Editing
If you start from scratch the right column (your translations) will be empty. You can edit a line by selecting it with the mouse.
As you select it, the editor in the lower part of the window will gain the focus and you can start typing. The text you type will
appear in the editor below and in the selected table row.
If the default text does not need a translation, simply double click the row in the table. This will copy the default text to your language.
Some translations contain HTML and should be translated with a similar formatting. This requires some very basic knowledge of HTML. If in doubt,
replace the words and copy the HTML code. HTML formatted text can be larger than the table row which makes it very difficult (or impossible) to
check the appearance. To solve this problem, the table cells provide a tooltip that shows the formatted text in full size.
There are some tokens that have a special meaning:
- LOCALE: the name of your language in your language
- TRANSLATOR_NAME: place your name here, it will be visible in the "About" box of JSchem later
- Tokens of the form <ITEM>_TOOLTIP: these are explanations for the GUI items that display the text contained in the token <ITEM>
- Tokens of the form MENU_<ITEM>: these are menu items. Many of these also have a _TOOLTIP token. Please do not forget the trailing "..." if the default translation has
them
- Tokens of the form <ITEM>_ACC_MAC: These are menu accelerator key for Mac OS where they are different from other OSses and should simply be copied
4. Checking
When you think you are finished, you can use the menu entry File->Check to run a simple consistency check. If there are potential problems
you will be prompted with a list of errors. Double click an error in the list to jump to the entry in your translation for correction.
5. Saving
If everything is fine you can save the translation bundle via File->Save As.
The translation bundle can be saved at any stage of the translation process and re-opened later.
Please note: due to its simplicity the Translation Editor does not check whether you overwrite an existing file. Be careful!
6. Testing in JSchem
To check your translation bundle in JSchem, save the translation bundle to a file named "translation.zip" in the same directory as the JSchem application and
restart JSchem.
JSchem will use the translation in that file (if it is present) instead of the builtin data.