Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > Welcome to Hackint0sh.org iPhone forums! > Genius Bar - HowTos, Guides and Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-28-2008, 07:07 AM
ifeghali's Avatar
ifeghali
Status: Offline
Supporter
 
Join Date: Mar 2008
Location: Rio de Janeiro, Brazil
Posts: 19
Rep Power: 0
ifeghali is on a distinguished road
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:
Quote:
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:
Quote:
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:
Quote:
--- 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:
Quote:
./runConfigureICU MacOSX --disable-samples --disable-draft --disable-extras --disable-tracing --disable-tests
and make it:
Quote:
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:
Quote:
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:
Quote:
-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:
Quote:
/usr/src/icu-3.4.1/source/bin/genrb pt.txt
and re-package:
Quote:
/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
Quote:
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 02:53 PM. Reason: attaching the method to the body of the post
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-29-2008, 08:36 PM
BiOsS
Status: Offline
Member
 
Join Date: Aug 2007
Posts: 90
Rep Power: 7
BiOsS is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-30-2008, 01:48 AM
ifeghali's Avatar
ifeghali
Status: Offline
Supporter
 
Join Date: Mar 2008
Location: Rio de Janeiro, Brazil
Posts: 19
Rep Power: 0
ifeghali is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #4 (permalink)  
Old 03-30-2008, 12:09 PM
BiOsS
Status: Offline
Member
 
Join Date: Aug 2007
Posts: 90
Rep Power: 7
BiOsS is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 03-31-2008, 05:26 AM
ifeghali's Avatar
ifeghali
Status: Offline
Supporter
 
Join Date: Mar 2008
Location: Rio de Janeiro, Brazil
Posts: 19
Rep Power: 0
ifeghali is on a distinguished road
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

Quote:
I edited phone’s icu all working great … thank you
you are welcome.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 10:26 PM
PowerBook_165c
Status: Offline
Junior Member
 
Join Date: Apr 2008
Posts: 6
Rep Power: 0
PowerBook_165c is on a distinguished road
Default

I am stucked with the install. Neither this

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

Quote:
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #7 (permalink)  
Old 04-14-2008, 03:57 PM
ifeghali's Avatar
ifeghali
Status: Offline
Supporter
 
Join Date: Mar 2008
Location: Rio de Janeiro, Brazil
Posts: 19
Rep Power: 0
ifeghali is on a distinguished road
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 04-14-2008, 08:34 PM
PowerBook_165c
Status: Offline
Junior Member
 
Join Date: Apr 2008
Posts: 6
Rep Power: 0
PowerBook_165c is on a distinguished road
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...?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 04-15-2008, 11:10 PM
PowerBook_165c
Status: Offline
Junior Member
 
Join Date: Apr 2008
Posts: 6
Rep Power: 0
PowerBook_165c is on a distinguished road
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)...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #10 (permalink)  
Old 04-17-2008, 04:28 AM
ifeghali's Avatar
ifeghali
Status: Offline
Supporter
 
Join Date: Mar 2008
Location: Rio de Janeiro, Brazil
Posts: 19
Rep Power: 0
ifeghali is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +2. The time now is 09:04 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105