Cool localisation stuff happening with PackageKit

Package spec files and PackageKit backends are rarely localised. This doesn't matter much if you speak English, but really sucks if you don't. We can't fix all the distro tools and all the packages in the world, but we can do our best to be clever:

This is with my locale set to “en_GB” and the libpackagekit results hardcoded to “fr” – the two will match up eventually of course.

Theres a new GObject called PkExtra in libpackagekit that lets you query (as a user) a small cached sqlite repository containing all the localisations and icon names. The data from this is populated per system (as root) from a few information sources:

  • All the installed desktop files in /usr/share/applications (this works now)
  • Metadata from the online desktop project (to get things like popularity, WIP)
  • Information about non-installed packages generated from the distro builder (WIP)

I don't think caching the installed icons and shipping them seporatly is a good idea, just from a size point of view.

The sqlite database is currently at 200kb in size with 201 applications installed (i.e. things that ship desktop files) so I'm guessing it would be couple of Mb with the entire fedora repository of information in and the online desktop stuff. Of course, being sqlite, it's very quick to query.

Updating the offline repo would be left to the distro packager, as of course, this stuff is all per-distribution. There is lots of stuff still to work out, but slowly, it's coming together. Comments welcome.