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 ...
-
Supporter Array
[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:
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:
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:
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 02:53 PM.
Reason: attaching the method to the body of the post
-
-

Originally Posted by
ifeghali
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.
-
-
Supporter Array

Originally Posted by
BiOsS
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.
-
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
-
-
Supporter Array

Originally Posted by
BiOsS
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.
-
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?
-
-
Supporter Array

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

Originally Posted by
ifeghali
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...?
-
-

Originally Posted by
PowerBook_165c
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)...
-
Supporter Array
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.
-
Similar Threads
-
By timschuerewegen in forum General
Replies: 33
Last Post: 05-04-2008, 01:19 PM
-
By fdmendez in forum General
Replies: 0
Last Post: 10-08-2007, 08:23 PM
-
By MaLer in forum General
Replies: 0
Last Post: 08-28-2007, 01:01 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks