Page 1 of 2 12 LastLast
Results 1 to 10 of 14
Discuss [HOWTO] hack iphone locales at the Genius Bar - HowTos, Guides and Tutorials - Hackint0sh.org; I could manage to edit the resources inside the iPhone ICU data file. someone might ...
  1. #1
    Supporter Array ifeghali's Avatar

    Join Date
    Mar 2008
    Location
    Rio de Janeiro, Brazil
    Posts
    19
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default [HOWTO] hack iphone locales

    I could manage to edit the resources inside the iPhone ICU data file. someone might find it useful:

    http://ifeghali.blogspot.com/2008/03...e-locales.html

    For your convenience, I am gonna post the method here. Be warned that updates that goes to the above link might not go here. So be sure to check both sources (here and link).

    You may already seen out there some projects that translates the iPhone user interface to many different languages. Locale strings are stored in a totally different way though. Things like "Monday" and the Portuguese equivalent "Segunda-Feira" are stored in a ICU (International Components for Unicode) data file.

    For 12 mondays I had to stand looking at "Segunda-Feira" being printed out of the bounds of iCal icon. Until today. I tried fgrep'ng the whole iPhone for the string "segunda" with no luck. Then I tried converting all the plists from binaries to XML and fgrep'ng again and still no luck. Doing some research I found that apple uses ICU on iPhone, which drove me to find our /usr/share/icu/icudt34l.dat. This is a 8.5MB file bundled with all the locales (timezones, region formats, etc.).

    To start playing with it, the first thing we will need is obviously the file itself:
    cd /tmp
    ssh root@iPhone cp /usr/share/icu/icudt34l.dat /usr/share/icu/icudt34l.dat.bak
    scp root@iPhone:/usr/share/icu/icudt34l.dat .
    Now we need the ICU version 3.4 tools. Again, I don't like macports or fink so I had a bad time trying to compile it myself (remember I am on a Mac OS X Leopard). You have now the cake recipe:
    cd /usr/src
    wget ftp://ftp.software.ibm.com/software/.../icu-3.4.1.tgz
    tar -zxf icu-3.4.1.tgz
    mv icu icu-3.4.1
    cd icu-3.4.1/source
    For some weird reason the configure script for darwin is broken, so I had to fix that with the following patch:
    --- config/mh-darwin 2004-05-18 18:54:24.000000000 -0300
    +++ config/mh-darwin.new 2008-03-27 23:48:45.000000000 -0300
    @@ -58,6 +58,7 @@
    @echo "generating dependency information for $<" @$(GEN_DEPS.c) $< > /dev/null
    @mv $@ $@~
    - @echo -n "$@ " > $@
    @cat < $@~ >> $@
    @-rm $@~

    @@ -65,6 +66,7 @@
    @echo "generating dependency information for $<" @$(GEN_DEPS.cc) $< >/dev/null
    @mv $@ $@~
    - @echo -n "$@ " > $@
    @cat < $@~ >> $@
    @-rm $@~
    Now we can run configure:
    ./runConfigureICU MacOSX --disable-samples --disable-draft --disable-extras --disable-tracing --disable-tests
    and make it:
    make
    sudo make install
    I couldn't manage to get file from bin/ installed on my system, but anyway I wasn't really interested on going deeply on that. Heck, I want to get rid of that "Segunda-Feira" thing !

    Lets extract our package now:
    cd /tmp
    /usr/src/icu-3.4.1/source/bin/decmn icudt34l.dat --pkgdata > out.lst
    cd icudt34l
    boom ! we got a lot of files... and look who is laying around:
    -rw-r--r-- 1 igor wheel 51K Mar 28 00:14 pt.res
    -rw-r--r-- 1 igor wheel 496B Mar 27 23:06 pt_BR.res
    -rw-r--r-- 1 igor wheel 3.7K Mar 27 23:06 pt_PT.res
    The file we want is pt.res, but its a binary file. I couldn't manage to convert it back to something readable but again I am more interested in the quickest solution possible. Just download the pt.txt here. Near to the end you will find the calendar day names. Edit accordingly. Important: remember to use UTF-8.

    Now its time to generate our new resource:
    /usr/src/icu-3.4.1/source/bin/genrb pt.txt
    and re-package:
    /usr/src/icu-3.4.1/source/bin/gencmn -v -n icudt34l 0 < ../out.lst
    At this point you cross your fingers and hope this works... worked for me
    scp icudt34l.dat root@iPhone:/usr/share/icu
    reboot and you are all set.

    If you can read Portuguese you might find this entry interesting as well. It describes the similar process of updating Mac OS X timezone. It makes use of `icupkg` though, that is not available on ICU version 3.4.
    Last edited by ifeghali; 03-29-2008 at 01:53 PM. Reason: attaching the method to the body of the post



  2. #2
    Professional Array

    Join Date
    Aug 2007
    Posts
    90
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    11

    Default

    Quote Originally Posted by ifeghali View Post
    For some weird reason the configure script for darwin is broken, so I had to fix that with the following patch:
    can i have more information about the patching process please i'm stuck at this step ... thanks.

  3. #3
    Supporter Array ifeghali's Avatar

    Join Date
    Mar 2008
    Location
    Rio de Janeiro, Brazil
    Posts
    19
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by BiOsS View Post
    can i have more information about the patching process please i'm stuck at this step ... thanks.
    which operating system ?

    for Mac OS X for instance you just have to edit config/mh-darwin and remove two lines identical to this one:

    @echo -n "$@ " > $@

    save the file and go ahead in the process.

    regards,
    iGor.

  4. #4
    Professional Array

    Join Date
    Aug 2007
    Posts
    90
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    11

    Default

    Appreciate your reply but I managed by replacing config/mh-darwin from icu 3.8.1

    I edited phone’s icu all working great … thank you

  5. #5
    Supporter Array ifeghali's Avatar

    Join Date
    Mar 2008
    Location
    Rio de Janeiro, Brazil
    Posts
    19
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by BiOsS View Post
    Appreciate your reply but I managed by replacing config/mh-darwin from icu 3.8.1
    yeh that would be another way to do that

    I edited phone’s icu all working great … thank you
    you are welcome.


  6. #6
    Newbie Array

    Join Date
    Apr 2008
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I am stucked with the install. Neither this

    sudo make install
    Password:
    make: *** No rule to make target `install'. Stop.
    or this

    sudo make -f Makefile.in install
    Makefile.in:15: icudefs.mk: No such file or directory
    make: *** No rule to make target `@srcdir@/icudefs.mk.in', needed by `icudefs.mk'. Stop.
    gets me any further... What should I do?

  7. #7
    Supporter Array ifeghali's Avatar

    Join Date
    Mar 2008
    Location
    Rio de Janeiro, Brazil
    Posts
    19
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by PowerBook_165c View Post
    I am stucked with the install
    did you run `runConfigureICU` first ? what about `make` (no arguments) ? which ICU version ? which OS ?

  8. #8
    Newbie Array

    Join Date
    Apr 2008
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by ifeghali View Post
    did you run `runConfigureICU` first ? what about `make` (no arguments) ? which ICU version ? which OS ?
    The problem was actually that - for reason unknown to me - gcc was not installed properly (by installing Xcode). I re-installed Xcode and got it working, and nearly finished it. However, now I'm stuck in the last phase (before installing the .dat file to iPhone)... When making 'gencmn' I'll get an error:

    Code:
    gencmn: unable to open listed file CurrencyData.res
    I thought it might get 'broken' somehow in extracting .dat file, and downloaded CurrencyData.txt from http://source.icu-project.org/repos/...rce/data/misc/. I did 'genrb' and got new CurrencyData.res but, unfortunataly, could not get any further (got the same error). I have not modified CurrencyData.res in any way, only fi.txt (fi.res) file (analog to pt.txt file).

    Any ideas...?

  9. #9
    Newbie Array

    Join Date
    Apr 2008
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by PowerBook_165c View Post
    Any ideas...?
    I cannot get any other reason for this error but files must be somehow in wrong directory... When I did extract .dat file it created a folder 'icudt34l' to the same folder where extract command 'decmn' is placed (/icu-3.4.1/source/bin/). Also out.lst was generated there.

    Therefore the file/folder structure is as follows

    /icu-3.4.1/source/bin/
    - icudt34l/ (includes all the .res files)
    - out.lst
    - all bin commands such as 'gencmn'

    The question is, where the following file and folder should be placed in relation to 'gencmn' command:
    1. icudt34l/ folder (including all the .res files)?
    2. out.lst file?

    I have tried all variables I could imagine possible:
    1. gencmn, icudt34l/ and out.lst in the same /icu-3.4.1/source/bin/ folder
    2. gencmn in /icu-3.4.1/source/bin/ folder, .res files and out.lst file in /icu-3.4.1/source/bin/icudt34l/ folder
    3. out.lst in /icu-3.4.1/source/ folder, gencmn in /icu-3.4.1/source/bin/ folder, .res files in /icu-3.4.1/source/bin/icudt34l/ folder

    I guess the problem was created since I do not want to do all this in iPhone but in Mac, and for obvious reasons I do not want to use /usr/ folder (but /Users/ folder)...

  10. #10
    Supporter Array ifeghali's Avatar

    Join Date
    Mar 2008
    Location
    Rio de Janeiro, Brazil
    Posts
    19
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    dude read the tutorial carefully, step by step. note all the `cd`s and where the commands are being executed. if you skip one block of code you will get in trouble. you have to pay attention to every single one of them. you will copy the dat and extract the lst to /tmp. you will also extract the dat to /tmp/icudt34l. again, read the tutorial carefully.


 

 
Page 1 of 2 12 LastLast

LinkBacks (?)

  1. 04-11-2010, 07:16 PM

Similar Threads

  1. Replies: 33
    Last Post: 05-04-2008, 01:19 PM
  2. Replies: 0
    Last Post: 10-08-2007, 08:23 PM
  3. Replies: 0
    Last Post: 08-28-2007, 01:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 06:39 AM.
twitter, follow us!