The localization
component type describes language packs for individual software components or groups
of software components. A language pack includes anything necessary to localize a software component for a specific language
and/or country. This is usually translations, but may also be translated media content, currency information and other things.
A localization
component extends
one or multiple other components and defines the
languages it provides via its languages
tag.
Language packs can ship one or more metainfo files as /usr/share/metainfo/%{id}.metainfo.xml
.
Do not confuse language packs with the catalog metadata <languages/> tag, used to identify bundled translations.
A localization metainfo file can look like this:
<?xml version="1.0" encoding="UTF-8"?>
<component type="localization">
<id>org.kde.l10n.de</id>
<name>KDE German Language</name>
<summary>German localization for the KDE desktop and apps</summary>
<extends>org.kde.plasmashell</extends>
<extends>org.kde.gwenview.desktop</extends>
<extends>org.kde.dolphin.desktop</extends>
...
<url type="homepage">http://i18n.kde.org/team-infos.php?teamcode=de</url>
<metadata_license>FSFAP</metadata_license>
<developer_name>The KDE German L10N team</developer_name>
<languages>
<lang>de_DE</lang>
<lang percentage="96">de_AT</lang>
<lang percentage="100">de</lang>
...
</languages>
</component>
Note that the XML root must have the type
property set to localization
.
This clearly identifies this metainfo document as describing a language pack.
For localizations, the value of the <id/>
tag must follow the reverse-DNS scheme as described for generic components.
Ideally, the name of the component this language pack is for should be suffixed with .l10n.%{lang}
, where %{lang}
is the language code of the language pack.
For example, if your applications component-id is org.gimp.gimp
the ID of the German language pack
for GIMP should be org.gimp.gimp.l10n.de
.
The extends
tags contain all the components this language pack can be used with.
This tag gives information about the locale a localization component provides support for.
The tag is allowed to only occur once per component, and contains multiple <lang/>
child nodes, which have
a language code (https://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html) as value.
Each <lang/>
node may have a percentage
property, which describes the percentage value to which
a component has been translated.
Tag example:
<languages>
<lang>de_DE</lang>
<lang percentage="94">de_AT</lang>
</languages>
For a component of type localization
, the following tags are required and must be present for a valid document:
<id/>, <name/>, <summary/>,
<metadata_license/>, <extends/>, <languages/>.