How to add a new locale to Nokia 770

Below are steps on how to add a new locale to Nokia 770. I have added "zh_CN" locale to my Nokia 770 successfully, but I think it's a "ugly" way to do this. Also note I only test this on IT OS 2006. So please do this on your own risk.

On your PC:

1. Prepare a Maemo development environment. Using ARMEL SDK rootstrap, install 'locales' package in scratchbox. After that, run 'localdef' to compile a new locale:
[sbox-SDK_ARMEL: ~] > apt-get update
[sbox-SDK_ARMEL: ~] > fakeroot apt-get install locales
[sbox-SDK_ARMEL: ~] > localedef -f UTF-8 -i zh_CN zh_CN

2. Verify it in sbox:
[sbox-SDK_ARMEL: ~] > localedef --list-archive
You should see the newly added locale in the output.
3. Copy /usr/lib/locale/locale-archive to your device.

On your device

4. Upgrade your device to Internet Tablet OS 2006.

5. Add Maemo Garage and Maemo respository to your Application Catalogue.

6. Follow this howto to get root access. You need install Xterm and Dropbear on your device.

7. Install 'locales' package by run this command in Xterm (as root):
# apt-get install locales
8. Copy your font files to /usr/share/fonts/truetype, you may create a subdirectory for your font files in it. Run following commands to add the fonts:
# fc-cache -f -v
# fc-list

9. Copy message files from 'en_GB' locale to your locale:
# cp -i /usr/share/locale/en_GB/LC_MESSAGES/*.mo \
/usr/share/locale/zh_CN/LC_MESSAGES/

Note: DON'T overwrite those existing mo files.

10. Overwrite existing locale-archive file. Backup the original /usr/lib/locale/locale-archive first, then overwrite it by the one from sbox. DON'T use 'cp' command directly. It may cause the device to reboot. I use following commands to avoid this:
# cp /media/mmc1/locale-archive /usr/lib/locale/locale-archive-new
# cd /usr/lib/locale
# echo ""> locale-archive \
&& mv locale-archive-new locale-archive

11. Verify it on your device:
# locale -a
Now, you should view characters in your language on Nokia 770, including Opera browser, Rss feed reader, File manager, etc. I put some screenshots on flickr.

In case something is wrong, you can reflash your device with the IT OS 2006 image.

Known issues:

  1. Web page title may not be displayed correctlly.
  2. DON'T change your region settings to your locale or you will NOT be able to input anything because the virtual keyboard disappears.

32 Replies to “How to add a new locale to Nokia 770”

  1. Your are rock. You have done a hack of job. How is the loading speed when you use Opera to display sina.com and google Chinese news? Would it be possible to build a package to automate this process to enable Nokia 770 to work with Chinese font? How to enable Nokia 770 to have Chinese pinyin input? Would you please advise? Thank you. Again, What an Excellent job you have done.

  2. Thanks for your comment. :) I just do a little becaue 770 is already i18n enabled.

    >> How is the loading speed when you use Opera to display sina.com and google Chinese news?
    Good. Just as you are using your PC.

    >> Would it be possible to build a package to automate this process to enable Nokia 770 to work with Chinese font?
    Yes. I plan to do it.

    >> How to enable Nokia 770 to have Chinese pinyin input? Would you please advise?
    There is a lot of work to do to enable Chinese characters input, I think. It says Nokia will add these features on the coming release.

  3. So great! I have not installed Linux on my notebook. Would you like to share the locale-archive file for us? Thanks.

  4. I copied fireflysung.ttf to /home/user/.fonts/
    and all applications can display chinese fonts correctly except opera. Is it possible that something need to be done in opera itself such as opera.ini? Could you please advise? Thanks.

  5. I followed your instructions to install chinese font in Nokia 770. It is working now. Thank you very much.

  6. Thanks to wolfg. I was able to add the Chinese font in Nokia 770 with 2006os. Yes, the Chinese fonts is working in all applications including opera. The performance/speed of browsing web page (English or Chinese) is as good as the default font that comes with 2006os. The following is a summary of the instructions I learned from wolfg (http://guoyong.org/2006/08/03/247):

    1. Find a copy of Truetype Chinese font. Fonts, simsun.ttf and simhei.ttf do not seem work in opera. Font fireflysung.ttf (link: http://www.study-area.org/apt/firefly-font/ ) works.
    2. Run x-terminal
    3. Execute command sudo gainroot to enable root access privilege.
    4. Copy fireflysung.ttf to /usr/share/fonts/fireflysung.ttf
    5. Execute command fc-cache –f to rebuild system font cache information.
    6. Exit from x-terminal.
    7. Reboot the device
    8. Now opera and all applications should be able to display Chinese font correctly.

    In order to have the theme display Chinese font on the title bar correctly additional steps as described below are needed (http://guoyong.org/2006/08/11/248):

    1. Run x-terminal
    2. Execute command sudo gainroot to enable root access privilege.
    3. Locate the theme type you selected. For example:

    Deck-top theme color file
    Theme1 orange /usr/share/themes/default/matchbox/theme.xml
    Theme2 light blue /usr/share/themes/theme1/matchbox/theme.xml
    Theme3 dark blue /usr/share/themes/theme2/matchbox/theme.xml
    Theme4 gray /usr/share/themes/theme3/matchbox/theme.xml

    4. Change to directory where the theme you used is located. For example:

    cd /usr/share/themes/default/matchbox/

    5. Make a backup copy

    cp –i theme.xml theme.xml.original

    6. Copy theme.xml to mmc card

    cp -i theme.xml /media/mmc1/theme.xml

    7. Execute command fc-list to find the exact font name you installed for use later.

    8. Open file theme.xml that is located in mmc card with Notes program (comes with 2006os).
    9. Find the line that defines the font as shown below:

    10. Add the new font name and font size to it. Separate the fonts with |

    The modified line is as shown below:

    11. Save it.

    12. Copy the modified theme.xml back to its original directory and overwrite it.

    cp -i /media/mmc1/theme.xml /usr/share/themes/default/matchbox/theme.xml

    13. Exit from x-terminal.
    14. Reboot the device
    15. The device is good to go.

  7. I received my 770 yesterday then I carried out the above procedure. Now it works perfectly.
    Great thanks to wolfg and hower!

  8. i have just add SimSun18030.ttf to /usr/share/fonts directory and run fc-cache -f, opera can display chinese now.

    but after change theme.xml, the title bar still can not display chinese. (fc-list font name is "SimSun\-18030,宋体\-18030" and "NSimSun\-18030,新宋体\-18030")。

    is there any suguestion?

    thanks.

  9. Hi!. :)
    I was wondering if with the holder on, you are able to desplace the 770 horizontally so that the USB port (or all of them) fit the hole so they are usable. I was thinking about connecting the audio output to the car-audio input, and the USB to a portable HardDisk carrying my MP3 collection.
    Nice blogging, keep it up!

    Thanks ;)

  10. nice work, wolfg!

    hower, from your brief instruction, it seems that you didn't build 'locale' or run 'Dropbear' (as per wolfg).
    I just got 770 and am trying to get my language added. As with zero knowledge about linux, could you please write the instruction in more details please. ( I have tried but it didnt work, I am using the memory card that came with 770 and I got the fonts saved on it.)

    Please help!, Thanks so much!

    rck

  11. Thanks for the reply, wolfg. About those post,I could not read those posts... not my language - -:
    I would like to add Thai fonts. I followed the instruction from your blog but it didn't get through.
    I thought I might missed something alonng the way, but I just couldn't tell what went wrong cuase I am new to Linux. I got Xterm installed and 2006 OS. I thougth it might be that I didnt have root access, can you do that without wireless access? I read from Maemo, you need it.

  12. Hi Wolfg,

    I just got the root access and tried to install 'thaimono.ttf' from the memery card. Here is what's shown on the screen:
    _________________________________________________________
    Nokia770-39:~# cp -i /media.mmc1/thaimono.ttf /user/share/fonts/thaimono.ttf

    cp: /media/mmc1/thaimono.ttf: No such file or directory
    _________________________________________________________
    Did I miss anything? /--\

    Thanks for your kindly help. ;-)

  13. sorry, typo. I tried again following what you suggested, but I still got

    cp: /media/mmc1/thaimono.ttf: No such file or directory

    -could it be file problem, I got other ttf files too, about 0.2MB each, tried them all and didn't work?
    -could it be something in the commmand that does not allow me to access the card?

  14. Hi wolfg,

    I made a script file called test (without any extension) in /usr/bin/test in nokia 770
    containing the following lines and saved in utf-8 encoding

    #!/bin/sh

    ls /media/mmc1/books
    cd /

    I also made it exectuable by typing the following after enable root

    chmod a x /usr/bin/test

    But when I run the script by typing test, it did not work.

    Could you please advise what is the problem?

    Thanks

    hower

  15. Can you give me the result of "ls -l /usr/bin/test"?
    Also after run the script, type " echo $?" to what output will be given? 0 or 1?

  16. This is the result:

    /usr/bin # chmod a x /usr/bin/test
    /usr/bin # ls -l /usr/bin/test
    -rwxr-xr-x 1 root root 38 Dec 2 18:58 /usr/bin/test
    /usr/bin #

    /usr/bin # test
    /usr/bin # echo $?
    1
    /usr/bin #

    hower

  17. Thanks. You were wright. The problem was due to encoding.
    If I stay with vi editor then it is working.

  18. My Nokia 770 internal memory is getting less and less. I am thinking to extend the root file system into mmc card.
    I like wolfram's extrootfs.deb very much. It was working very well in 2005os. Now I am using 2006osv2. It was not ported into 2006osv2.
    I am thinking to modify the extrootfs scripts and copy it to /usr/bin/, so I can run it in 2006osv2.

    Here is what I am thinking to try:

    A. insert "insmod /mnt/initfs/lib/modules/current/ext2.ko" near the top of /etc/init.d/minircS just after the PATH= line
    B. modify extrootfs scripts as below:

    1. replace "/var/lib/install" with "/usr/bin /usr/share/fonts" in line 2
    2. replace "ext3" with "ext2" in line 25

    C. copy he file to /usr/bin/extrootfs
    D. make it exectuable, chmod a x /user/bin/extrootfs

    Do you think it is workable?

    Do you have an updated version for 200osv2? Would you like to share it with us, if you have something likt this?

    Thaks for your help.

    hower,

  19. Hi,

    I've found out about this post from people in INdT. I wanted to add Serbian translation to Canola, and was unable since Serbian locales were missing on the device. I've installed the SDK and followed your instructions on the PC side.

    However on nokia device, I didn't install locales package (its 4Mb packged 10MB of space on a root system). Instead I've continued to follow instruction and still got my locales installed (skipped font parts since, fonts are OK for Serbian). I would appreciate if you can explain why did you choose to perform apt-get install locales?

    Best regards,

    Momcilo Majic

  20. Hi Wolfg, I have installed your chinese font and theme into my 770. However when I go to news.163.com and try to subscribe RSS, 770 told me it's invalid address and cannot add RSS. I can read chinese without problem. Could you tell me what can I do in order to add 163's RSS? Thanks,

  21. Hi all

    I wondering Is anybody has sucessfully installed Thai font in Nokia N800? if do so, please share .

    Thanks in advance.

Comments are closed.