Reply
Thread Tools
Posts: 178 | Thanked: 91 times | Joined on May 2011 @ Mira (Venice) - Italy
#1
READ EVERYTHING BEFORE TYPE COMMANDS IN THE TERMINAL


I'm still testing this little tweak, I'm not responsible for what you are doing with your phone. If your phone won't boot up it's your fault. If everything that is written in this post broke, slow or change the experience that you have on your phone, it's your fault. You have been warned!


As you know you can switch your phone language easly, it's a nice feature but a lot of pepole after the initial setup do not change the language. You do not use them but the other languages are stored in your phone.

Run the commands from a root shell, use: devel-su

Open the terminal and write:
Code:
cd /usr/lib/locale
ls -lh
You shuld see something like this:
Code:
-rw-r--r-- 1 root root 110M 2015-02-10 22:42 locale-archive
-rw-r--r-- 1 root root    0 2014-12-10 18:35 locale-archive.tmpl
The locale-archive isn't so small. But you can reduce the size by removing all the unused locales in this way (do a backup of that file before doing anything):
  1. List all locales and save them in a file
    Code:
    localedef --list-archive >> /home/nemo/locale_list.txt
    Now there is a "locale_list.txt" with all the diffrent locales avaible.
  2. Locate what you want to keep
    Open "locale_list.txt" (transfer it to you pc, look at it with cat | less, do how what you want) and remember everything that you want to keep.
    In my case I'd like to keep only Italian (the current installed language) and english (keep it, also if you don't use it, just keep it).
  3. Delete everything else
    I want to delete everithing that do not begin with "en" and "it" so my final command will be:
    Code:
    localedef --list-archive | grep -E -v "^en|^it" | xargs localedef --delete-from-archive
    Another exemple: If you want to keep french, english and spanish instead of grep -E -v "^en|^it" you will use grep -E -v "^en|^it|^fr|^es". (yes language code for spanish is "es")
    Or maybe only english: grep -E -v "^en"
    Remember to separate every language with "|" and to add "^" before the first two letter of every language code.

To commit your changes use:
Code:
build-locale-archive
If build-locale-archive fail and return this error:
Code:
/usr/sbin/build-locale-archive: cannot read archive header
Try to run (and say yes to overwrite):
Code:
mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
After running build-locale-archive your jolla phone will automatically reboot, so do not run this last command with an ssh shell (there are no real problem about it, but do not do it).

Now my /usr/lib/locale looks like this:
Code:
-rw-r--r-- 1 root root 3,4M 2015-02-10 22:42 locale-archive
-rw-r--r-- 1 root root    0 2014-12-10 18:35 locale-archive.tmpl
From 110MB to 3,4MB

From now do not change the system language!
You are still able to change the language in the Settings app, but do not select langauges that you have removed. At least, before do that, restore the previous backup, that you have done before touching system critical files, you have done a backup of that file yes? If not and something is not working... it's your fault. The only last hope is to recover that file somwhere around the internet and or reset your phone (or wait for an OS update, it restore the file). Agian you have been warned, do not come to complain in this thread.

If someone know how to hide some lang from the Settings app write it here, thank you

After an OS update the file will be downloaded and built again, so you have to run all these commands again.

Last edited by Vento; 2015-02-18 at 10:21.
 

The Following 3 Users Say Thank You to Vento For This Useful Post:
Posts: 646 | Thanked: 1,124 times | Joined on Jul 2010 @ Espoo, Finland
#2
Any other advantage apart of saving ~100MB (or perhaps not even that, if you are keeping the default file as backup on the phone itself ) ?
 
Posts: 178 | Thanked: 91 times | Joined on May 2011 @ Mira (Venice) - Italy
#3
Originally Posted by minimos View Post
Any other advantage apart of saving ~100MB (or perhaps not even that, if you are keeping the default file as backup on the phone itself ) ?
The backup shuld go on your pc xD and btw no... not much.... btw better than nothing
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:17.