I wrote a new set of tools yesterday: trans-purge
It's inspired by localepurge
In our current desktop environment, there are a lot of
useless translations, apart from locales.
Many of them are in *.desktop files installed by each application.
Another place containing useless translations is the mime-database
Normally we only use English and our own native languages,
but there are often translations for more than 10 locales in these files,
which is a waste of disk space, and make our system slower.
There are currently 3 tools contained: desktop-purge, mime-purge, and gconf-purge.
desktop-purge will scan all installed *.desktop files on the system,
remove useless translations, and then save it back.
Usage: Run desktop-purge directly with root access.
The main programs which benefit from this is gnome-panel and other desktop panels.
The effect is apprant. The file size loaded at system startup decrease
from 2 MB to 2xx KB.
mime-purge removes unnecessary translations from mime-database
The main programs which benefit from this are file managers.
Usage: Run mime-purge directly with root access.
gconf-purge will remove useless translations in gconf schema, which saves 20 MB or so on my system.
Usage: Run gconf-purge directly with root access.
All unnecessary translations will be removed (Without backup)
The reserved translations contains English and the locale currently used.
Download URL:
http://pcman.sayya.org/desktop-purge.c
http://pcman.sayya.org/mime-purge.c
http://pcman.sayya.org/gconf-purge.c
To compile, type following commands:
gcc `pkg-config glib-2.0 --cflags --libs` -o desktop-purge desktop-purge.c
gcc `pkg-config glib-2.0 --cflags --libs` -o mime-purge mime-purge.c
gcc `pkg-config glib-2.0 --cflags --libs` -o gconf-purge gconf-purge.c
Then copy these files to /usr/bin.
Finally, I provide an automatic way.
Create this file manually: /etc/apt/apt.conf.d/99-transpurge,
and add following contents to it.
DPkg
{
Post-Invoke {"if [ $(ps w -p "$PPID" | grep -c remove) != 1 ]; then /usr/bin/desktop-purge > /dev/null; /usr/bin/mime-purge >/dev/null; /usr/bin/gconf-purge > /dev/null ; else exit 0; fi";};
};
This will purge unnecessary translations after installing packages with apt.
Warnings:
This program is released under GPL without any warranty. Use it at your own risk. (Theoratically, the most serious side-effect is translations in your language is accidentally removed, and only English left. This could happen under incorrect locale settings.)
I tested it on my system, and fonud it effective.
If you run the programs manually, it will show you how much disk space is saved.
Hope someone can create deb package for this, if there are not apparent bugs.
The package name can be trans-purge. Cheers!
Bookmarks