Join Today
+ Reply to Thread
Page 1 of 6 12345 ... LastLast
Results 1 to 10 of 53
Like Tree1Likes

Thread: How to make and include a new Language in a Language Pack

  1. #1
    Join Date
    May 2007
    Location
    Mumbai
    Posts
    3,011

    Default How to make and include a new Language in a Language Pack

    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.
    Last edited by Konig; 09-15-2009 at 07:41 AM.
    1318 likes this.


    We're watching you. Be afraid. Be very afraid.

  2. #2
    Join Date
    May 2007
    Location
    Mumbai
    Posts
    3,011

    Default

    Setting up the PC for your work

    Each language in the phone is defined by a set of .qm files. All text that is displayed in the respective language files are stored in CG41/language/string/. The different folders represent the languages in the pack. Each folder has 2 kinds of files: .qm and a readme.cfg file. The cfg file is simply the name of the language that appears in the Setup menu. The qm files are more important. There are 37 such files for each language. The names of the files are self-explanatory.

    To edit the .qm files, and to translate them to a language of your choice, you need a few simple tools:
    1. QM Parser
    2. Cygwin
    3. Notepad (not Notepad++)
    4. Translation software, or an online translation tool like Google Translate

    First of all, extract the .qm files from the phone. I'm assuming everyone would prefer using the English language as a base for translation. The English .qm files are located either in /usr/language/string/en-gb or /usr/language/string/emea, depending on the LP you use.

    Now setup your PC for the translation. Download Cygwin from here: http://www.cygwin.com/setup.exe, and in the menu that has the options for the various packages, make sure you select the one for Perl too. Let this process complete. Usually, it is installed to C:\cygwin

    Now, download the script attached to this post. Extract the file called qm2any.pl and place it in one of the folders in the Cygwin installation directory. I place it in the bin folder.

    Then, copy all the .qm files, and keep them in a folder, again within the Cygwin directory. I have created a folder called qm in the root of the Cygwin directory (C:\cygwin\qm)
    Attached Files Attached Files
    Last edited by Konig; 09-15-2009 at 12:47 PM.


    We're watching you. Be afraid. Be very afraid.

  3. #3
    Join Date
    May 2007
    Location
    Mumbai
    Posts
    3,011

    Default

    You will have to first convert them into .txt files, translate them, and then back to .qm files.
    Click on Cygwin.exe. A terminal will pop open. In there, type the following:
    Code:
    perl /bin/qm2any.pl


    All the options are as above.

    Now, we extract the text from one of the .qm files, and put it into a .txt file. Let’s take the example of the file for alarm clock. This one is called alarmclock_en-gb.qm. For the sake of example, I will extract the text to a file called 1.txt.
    Enter the following code:
    Code:
    qm2any.pl /qm/alarmclock_en-gb.qm –e 1.txt
    You should see the following output:


    Once you get the “Complete” message, navigate to C:\cygwin\home\”Username” which is your user name on the PC. There should be a file called 1.txt here. Open it with Notepad, not Notepad++. Now, simply replace the text in English here with the translated text. Don’t mess around with the spaces and order or you’ll have a phone that doesn’t make sense at all

    When you have finished translating the files, save it in the “Unicode Big Endian” encoding format, which is default.

    Once you have finished this, we have to recreate the .qm file. For this, I select the output to a new folder I created called “translated” in the root of the Cygwin directory. Also, instead on en-gb, I write whatever I need to distinguish it. For this example, I will write “xx”. If it were Hindi, I would write “hi”. Then, simply type the code below.

    Code:
    qm2any.pl /qm/alarmclock_en-gb.qm –r 1.txt –o /translated/alarmclock_xx.qm


    Once you finish all this, just put all your translated .qm files into a folder called xx. Update the readme.cfg file with whatever you want to be displayed in the setup menu where you choose the language.
    So what I did for the Hindi LP was to create a folder called “hi”, write “Hindi” in the readme.cfg file, and put all my translated files, with hi appended to them instead of en-gb, into this folder. I then simply put this new folder in CG41/language/string.

    Alternately, you can simply just replace the files in the English localization folder with the files here. If this is the case, you can let the _en-gb appended as it is. Only change the readme.cfg.
    Last edited by Konig; 09-15-2009 at 07:56 AM.


    We're watching you. Be afraid. Be very afraid.

  4. #4
    Join Date
    May 2007
    Location
    Mumbai
    Posts
    3,011

    Default

    You can then compile this into a firmware of your choice, and then flash it, or make an LP patch. To make the LP patch, use SBFCodec to open up the firmware, then delete all CGs except RDL3, CG34 and CG41. Then save this file as langpatch.sbf or whatever you want. Then open up ezxcodec, split the file, make the changes as described above for the respective directories, and repack it. You can then flash this updated patch without affecting your contacts, SMS and other data.

    For those who do not want to flash, and need a real time check of what they are doing is right, simply install the font and theme you created, and then mount as follows:
    Code:
    mount --bind /mmc/mmca1/english_cn.kbd /usr/language/inputmethods/english_cn.kbd
    Code:
    mount --bind /mmc/mmca1/string/en-gb /usr/language/string/en-gb
    For my work on the Hindi LP, look here: http://www.motorolafans.com/forums/d...n-project.html

    Thanks to:
    tmr for some excellent work here: http://www.motorolafans.com/forums/f...f-concept.html
    bOOster and mischka for some excellent tips here: http://www.motorolafans.com/forums/f...ion-guide.html
    eakrin for being a huge inspiraton behind working on LPs.
    My fellow mods, aksd, swifty, ndc, xeta, admin, g4m3rz, manup456, sabrod for keeping certain sections of the forum alive


    We're watching you. Be afraid. Be very afraid.

  5. #5
    Join Date
    Aug 2008
    Location
    Etawah the city of grt. DACOITS
    Posts
    4,897

    Default

    dude thanks for sharing such a nice guide
    Last edited by shantanu; 09-15-2009 at 07:51 AM.
    LG OPTIMUS 2X : MY INDROID EVOLUTION RC3
    SAMSUNG GALAXY SL : MY ANDROID EVOLUTION
    HTC ELFIN : MY DARIUS 6.5 ROM
    SONY ERICSSON X10 MINI : MINI EVOLUTION

    http://www.motorolafans.com/forums/signaturepics/sigpic64563_36.gif
    "GONE FOREVER TO MAKE A COME BACK"

  6. #6
    Join Date
    Jul 2005
    Location
    Franconia
    Posts
    4,866

    Default

    Looks like a lot of work and time you have spent on this
    Thanks!
    Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7. Gecko/20050511 Firefox/1.0.4

  7. #7
    Join Date
    Sep 2008
    Location
    Panipat, Haryana(INDIA)
    Posts
    1,725

    Default

    Thanks A Lot Konig


    There are only 10 type of people in the world: Those who know binary and those who don't.

  8. #8
    Join Date
    Sep 2007
    Location
    Germany
    Posts
    436

    Default

    Nice guide Konig with lots of informations. Good work!
    -------------------------------------
    In any apple is a worm. Through each window flies a bug.
    That's why I take Linux, because what does not fly can not crash.

  9. #9
    Join Date
    May 2007
    Location
    Mumbai
    Posts
    3,011

    Default

    Thanks for all the kind words
    Meanwhile, I have to rectify quite some points, as well as add some attachments and links
    This should be ready by tomorrow, hopefully
    And swifty, I did take a bit of time. Did it on the Touch HD
    Last edited by Konig; 09-15-2009 at 10:17 AM.


    We're watching you. Be afraid. Be very afraid.

  10. #10
    Join Date
    May 2008
    Location
    italy
    Posts
    819

    Default

    Very nice guide and very good work.
    Thanks a lot Konig.
    p.s.: I edit some string also with qmpare_032 (about qm)


 
+ Reply to Thread
Page 1 of 6 12345 ... LastLast

Similar Threads

  1. Language pack
    By 143moto in forum Firmware Development
    Replies: 1
    Last Post: 08-02-2009, 02:05 PM
  2. indian language pack for e6.
    By varundbest in forum Indian Lounge
    Replies: 6
    Last Post: 12-24-2008, 08:31 PM
  3. Language pack help please
    By navii in forum A1200 General Chat
    Replies: 1
    Last Post: 01-18-2007, 08:34 AM
  4. I need to make spanish language pack...
    By jzelaya in forum A1200 General Chat
    Replies: 9
    Last Post: 12-25-2006, 01:23 PM
  5. Making a Language Pack
    By mxwebman in forum E680i General Chat
    Replies: 0
    Last Post: 02-20-2006, 06:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Optimization by vBSEO 3.6.0 RC 1