[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

langupdate: prototype of how emdebian users could manage translations



emlocale is designed to split out translations into dedicated packages - reducing the installed size of the upstream Debian packages by only installing the translation files for the locale in use.

This needs a partner application, a userspace tool that queries the installed package list, checks for new translations and offers the user either a list or a direct install.

I struggled with doing this in dash yesterday (bash can almost do it, but dash fails to scope variables sufficiently and has *zero* documentation), so I've written a C&C++ app to do the job.

Why C and C++? Because there's no direct hook into apt-get upgrade and no easy way of reading the apt-cache from C without forking a call to apt-cache itself. So I use libapt-pkg which is a C++ library. The rest of the code is C because I prefer to use the memory management of glib2.

langupdate parses apt-cache to get a list of all possible packages. Then it parses /var/lib/dpkg/status to get a list of installed packages. It generates a package name for the translation file from each installed package and checks to see if this package name exists in the apt-cache. If it's not already installed, it selects that as a choice.

Currently, it's configured to check for -doc packages (because they already exist upstream) but it would check for -locale-$lang.

It's in SVN :
http://buildd.emdebian.org/repos/emdebian/trunk/langupdate/trunk

and a test package in my repository:
http://www.linux.codehelp.co.uk/packages/pool/main/l/langupdate/
(but please note, v0.0.1 looks for -doc packages, not -locale-$lang! - now this might be useful but it is only temporary!)
:-)

--

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpj9prNcb7zW.pgp
Description: PGP signature


Reply to: