Add appstream metadata to language packs

Bug #1678670 reported by Jeremy Bícha
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
langpack-o-matic
New
Undecided
Unassigned

Bug Description

appstream and GNOME Software has built-in support for language packs. It's worth looking into whether Ubuntu can benefit from this.

This integration is working in Fedora which now uses language packs. In Fedora, there is a category on GNOME Software's front page called Addons with a subcategory named Localization. (Other Addons subcategories are Codecs, Fonts, Input Sources and Shell Extensions [obviously only for GNOME Shell]).

From what I can tell, the way this works in Fedora is each language has a language pack metapackage. The metapackage then depends or recommends (what Fedora calls "weak dependencies") the language-specific packages. The metapackage also contains a very basic appstream metadata file. I'm attaching a file showing some of what this looks like.

However, Ubuntu's system is more complicated. Translations for specific package are only installed if the base package is installed. Maybe the 'extends' field in the localization metadata could do this, but we'd first have to create appstream metapackages for many of those packages which don't have it yet. Because Fedora's system is so much simpler, I don't know how well GNOME Software would handle this.

References
---------
https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Localization.html
https://fedoraproject.org/wiki/I18N/Language_Support_Using_Dnf
/usr/share/language-selector/data/pkg_depends

Tags: appstream
Revision history for this message
Jeremy Bícha (jbicha) wrote :
Revision history for this message
Matthias Klumpp (ximion) wrote :

The basic idea of AppStream language packs is that you can drop in as many as you want.

E.g. if Firefox has it's l10n data split into different packages, each one of these will get one AppStream metainfo snippet in /usr/share/metainfo describing which language the langpack supports and what software component it is for (in case of KDE, there will be multiple components).
The software center is supposed to check which software is installed and if there are language packs available for the current language, and then install them transparently.

So, what GNOME Software does now is pretty tailored to Fedora's way of doing things, and GS might need to be adjusted for this to work (otherwise the Addons->Langpacks menu will be pretty full of language packs for all kinds of stuff). One thing I could imagine is GS just grouping all language packs together by locale, and then only install the necessary bits if someone hits "Install" on one.

As for the generation of metainfo files, I wanted to add some small helper code to the cli tool, so we can quickly auto-generate them by a script at package build-time and don't need to fiddle with XML much.

Revision history for this message
Matthias Klumpp (ximion) wrote :

Oh, btw: If "extends" is missing, the SC is expected to always install the language and assume the langpack effects the whole system. This should be mentioned in the spec (I'll add it soon, I just noticed that this particular bit is missing).

Jeremy Bícha (jbicha)
tags: added: appstream
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.