How to create a Language Pack.
Creating a language pack involves 2 basic things:
1. Input method - keyboard
2. Strings - these have translations of the default text that appear natively on the phone.
1. Input method - keyboard
To create a working keyboard, you have to have a few things set up.
A. An image for the keyboard. For reference, you can split up the iconres.ezx in CG34 and have a look at the different language keyboards. Since you will most likely be editing an English keyboard, pay attention to the image reference. There are 2 kinds of files for English keyboards, one for the EMEA LP and the other for Chinese LP. You can identify the Chinese one by the letters 'PRC' in the name.
B. A .kbd file in CG41 that has mappings for the keyboard that you will edit.
C. Unicode definitions for each of the characters in the language that you wish to add to the keyboard
D. A font that displays characters in the language that you want.
The method to create a keyboard is very simple.
You first have to design the keyboard using Photoshop or a similar image editing tool. Where you put the characters is up to you, since you can define the input mapping in the kbd file.
Pay attention that there are places that you cannot reassign characters on the keyboard. For example, while making the keyboard for the Hindi LP, I had to take certain shortcuts. The English keyboard is defined by 4 separate areas in the kbd file. The default one is the QWERTY setup in lowercase. On pressing the Shift key (the arrow button), the uppercase keyboard is activated for a single click. The 3rd keyboard is the QWERTY in capitals. Pressing the shift key here takes you to the 4th keyboard for selecting a lowercase letter for a single click.
Since the Hindi language doesn’t have capital letters, what I did was to replace the QWERTY in capitals with one set of characters, and then the remaining in the area that defines lowercase for single clicks on pressing shift. This can logically be done for other languages too.
When you finish with the image, you will have to pack it into a theme file, and then install this theme. Remember, this keyboard will be shown only for this theme.
Once the keyboard image is ready, go to CG41 and look for the appropriate .kbd file. For the Chinese LPs, the file is called english_cn.kbd. In the EMEA version, it is called english_emea.kbd. Open this kbd file with Notepad++. You will now see different areas defined, with keyboard mappings that define what is displayed on the screen when the corresponding button is pressed.
You will have to enter the Unicode definition for each letter that you have introduced in the image. Each character has to be preceded by "0x" without quotes. For starters, I'd suggest changing just one character and then seeing if it works via a mount. Simply paste the edited file in the root of the memory card and type the following code:
Code:
mount --bind /mmc/mmca1/english_cn.kbd /usr/language/inputmethods/english_cn.kbd
or
Code:
mount --bind /mmc/mmca1/english_emea.kbd /usr/language/inputmethods/english_emea.kbd
depending on the type in your phone. You will have to make sure that an appropriate font is already installed. If this is successful, you can continue with the rest of the characters.
When you finish all the above, you can verify whether it works by simply testing it with mount commands.