Localization
This chapter deals with localizing JWPce.
Introduction
LJWPce supports localization of the interface. This allows the interface to be translated into another language. You can also use the localization ability to create larger dialog boxes or a dialog box with a different configuration without having to change the actual code.
JWPce localization is supported via the user of localization DLL, JWPce_lang.dll. This DLL is placed in the same location as JWPce and provides an alternative set of resources that JWPce will use.
Starting with version 1.34 JWPce allows most of the visual and all of the text elements of the user interface to be changed. This serves two functions. First, it allows the localization (translation) of the program into different languages. Second, it allows custom versions of some of the dialog boxes to be developed. For example, you could generate a version of JWPce with a very large dictionary dialog box for use on a system with a high-resolution monitor.
Language localization in JWPce
Internally, JWPce is contains English language menus, dialog boxes and text. Localization refers to the process by which JWPce can replace these elements with a different language.
Localization in JWPce is implemented by generation of a JWPce_lang.dll (Dynamic Link Library). If JWPce finds this DLL during startup (the DLL must also have the correct ID signature) many of the program’s resources (all of those containing text) will be loaded from the DLL not from the main program.
Translation Parts
In order to localize JWPce there are three things that must be localized:
- Menus: The main menu and the popup menus used ad various locations.
- Dialog Boxes: Static text that is used in the dialog boxes. Dynamic text used in the dialog boxes, as well as the text used in many of the message boxes is actually stored in the string table.
- String Table: All the text used in the programs. These are used to generate message boxes and other messages in the program.
Methods of generating a Localization
There are two ways to generate a localization of JWPce. Both ways are supported in this translation kit. The method you use is up to you and your abilities. The first way is only useable by people with some programming ability. The second way is usable by anybody.
Programmers Translation Kit
If you have access to a programming system that can work with Windows resource files, you can use the programmers translation kit. This kit contains all the files necessary to actually create the translation DLL. This has a number of advantages:
- You can make small adjustments to the dialog boxes to better adapt them to your language.
- You can test the translation on your own system.
- It takes less of my time, so the translation can be released much faster.
- There is no iteration process necessary since you can make all the adjustments necessary yourself.
Non-Programmer Translation Kit
Don’t worry if you don’t know anything about programming. You can use the non-programmer translation kit. To use this kit you just need to be able to read a standard text file and translate each line of text into your language. You return the text file to me and I will generate the translation DLL.
The major problem with this system is it takes more time. I will generate the best translation DLL I can from the data you give me. I will send this DLL and any questions I have back to you. You may then have to provide some more input and around we go until all the details are worked out.
Support
I will try to release updated translation kits as soon as new versions of JWPce come out. I will also try to make the source for the old translations available for new translators.
Double Translations
Double translations are a problem. If more than one person does a translation to the same language, I have no way to telling which is the better translation. This is a problem, and I don’t want to get involved in arguments about languages that I don’t know.
If you are intending to do a translation (for public distribution), please send me an email. Include the language you will be translating to and I will put your name on the web. This should reduce the number of double translations.
I should be reachable at:
grosenthal@physics.ucla.edu.Currently I maintain a web site to support JWPce:http://www.physics.ucla.edu/~grosenth/jwpce.htmlUnfortunately e-mail and web addresses do change. If you are having trouble reaching me, you might try checking the Monash Nihongo ftp Archive ( http://ftp.cc.monash.edu.au/pub/nihongo/00INDEX.html ).
Good Luck and enjoy!
-glenn
Non-programmer Translation Kit
The non-programmer translation kit consists of the single translation file. You will have to edit this file to make the changes that are necessary. This file is a text file, but you can edit it in any text-editor or word processor you want. You may want to use a word processor (such as Word) since the fonts will be proportional which better match the Windows system fonts..
There are actually three files. These correspond to the different versions of JWPce (not you do not have to translate all of them if you don’t want to):
language.txt Windows 95/98/ME/NT/2000/XP language-hpc.txt Windows CE – HPC version language-ppc.txt Windows CE – PPC version After you have changed the file you will need to return it to me. You can send it back as a text file or as a Word document. Please include a note with the language you are translating to.
Working with the language file
The format of the translation file is as follows:
- Lines beginning with # are description lines. These provide a description of what lines or groups of lines do in JWPce. You do not need to edit these lines. You should scan them for important information and instructions on the lines to be translated.
- The lines that need to be changed contain either text in quotes, or a marker followed by text in quotes. You should replace the text in quotes with the translated test. Please leave the quotes these are important to assembling the translated file.
- You should not change any of the markers or the order of the texts. I use these markers to reassemble the programming information.
For example, in the line:
IDS_CE_CLOSE "Closing User Conversions!"Leave the marker (IDS_CE_CLOSE), and replace the original text with your translation.
Hints and rules for making the translation
There are a number of rules that must be followed in generating your translation.
- The following symbols are special and you should not change them. If such a symbol is in the line you are working on you must make sure it is there in your translation:
Symbol Meaning “.” This is a place marker entry. The string is not used in the version of Windows you are translating for. Do not change this string just ignore it. & Indicates keyboard shortcut (the next character). \t Inserts a tab character, these are used for spacing or markers in the text string. \n Generates a new line, allows more than one line of text to be stored in a given string. %s During execution JWPce will insert text at this location (typically a file name). %d During execution JWPce will insert a number at this location. %x During execution JWPce will insert a number at this location. - Try to keep string lengths in the dialog boxes the same as the English length. This prevents problems putting the new strings in where the old strings were. Since Windows uses a proportional font to display dialog boxes, using a word processor can be helpful.
- If there are spaces at the end of the string don’t remove them, they are necessary.
- Make sure to include your name as the translator in the IDS_ABOUT_TEXT string.
- If you have any questions please ask me.
Please check the translate.doc file in the translation kit. It may contain more recent information.
Programmers Translation Kit
This section covers installing the programmers translation kit and generating the DLL. This translation kit is for people familiar with Windows programming and resources. If you are not, you probably should be using the non-programmer translation kit.
Requirements
The memory and disk requirements of the translation kit are small and should not provide a problem on any system. To use this system you have to have a compiler that can generate DLL files and a system for editing resource files. I personally use Microsoft Visual C++.
Installation
Installation is very simple:
- Create a directory
- Extract the contents of the correct archive into your directory.
- That’s it.
There are three different versions of the translation kits, based on the target system:
program.zip Windows 95/98/ME/NT/2000/XP program-hpc.zip Windows CE – HPC version program-ppc.zip Windows CE – PPC version
Using the translation kit
The localization DLL is empty. The DLL contains only the minimal amount of code necessary to generate a DLL, and a lot of resources.
This main code part is in JWPce_lang.cpp. You will not need (nor should you) change this code.
The resource part is stored in jwpce.rc. This is the file you will be changing.
The other major file is resource.h. This file must not be changed, or the JWPce will not be able to accurately access the resources you generate.
Hints and rules for making the translation
There are a number of rules that must be followed in generating your translation.
- The following symbols are special and you should not change them. If such a symbol is in the line you are working on you must make sure it is there in your translation:
Symbol Meaning “.” This is a place marker entry. The string is not used in the version of Windows you are translating for. Do not change this string just ignore it. & Indicates keyboard shortcut (the next character). \t Inserts a tab character, these are used for spacing or markers in the text string. \n Generates a new line, allows more than one line of text to be stored in a given string. %s During execution JWPce will insert text at this location (typically a file name). %d During execution JWPce will insert a number at this location. %x During execution JWPce will insert a number at this location. - If you make adjustments to the size of the dialog boxes please make sure they will still work on 640x480 display systems. If your translation requires a larger display size please let me know so I can let others know this.
- If there are spaces at the end of the string don’t remove them, they are necessary.
- There are hidden controls on some of the dialog boxes. These controls are necessary for the standardized dialog box routines to work. If these is a hidden control do not remove it (if you do Windows will crash). You can change the location, size, etc.
- Make sure to include your name as the translator in the IDS_ABOUT_TEXT string.
- If you have any questions please ask me.
Notes
If you send the DLL for distribution, please send the resource file also. Also remember to include the language you are translating to.
Please check the translate.doc file in the translation kit. It may contain more recent information.
Next Chapter: Utilities