appdata: Modernize, and translate it

This also revealed our translations were busted for .desktop files
as well, so rework the POTFILES.in generation to account for it
This commit is contained in:
Cole Robinson 2016-06-17 17:31:24 -04:00
parent 40e0354631
commit cf3a1cc1f0
3 changed files with 50 additions and 32 deletions

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2013 Cole Robinson -->
<application>
<id type="desktop">virt-manager.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Virtual Machine Manager</name>
<summary>Graphically manage KVM, Xen, or LXC via libvirt</summary>
<description>
<p>
Virtual Machine Manager provides a graphical tool for administering virtual
machines for KVM, Xen, and LXC. Start, stop, add or remove virtual devices,
connect to a graphical or serial console, and see resource usage statistics
for existing VMs on local or remote machines. Uses libvirt as the backend
management API.
</p>
</description>
<screenshots>
<screenshot type="default">http://virt-manager.org/appdata/en_US/manager.png</screenshot>
<screenshot>http://virt-manager.org/appdata/en_US/details.png</screenshot>
<screenshot>http://virt-manager.org/appdata/en_US/console.png</screenshot>
</screenshots>
<url type="homepage">http://www.virt-manager.org/</url>
<updatecontact>virt-tools-list@redhat.com</updatecontact>
</application>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>virt-manager.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<_name>Virtual Machine Manager</_name>
<_summary>Graphically manage KVM, Xen, or LXC via libvirt</_summary>
<description>
<_p>
Virtual Machine Manager provides a graphical tool for administering virtual
machines for KVM, Xen, and LXC. Start, stop, add or remove virtual devices,
connect to a graphical or serial console, and see resource usage statistics
for existing VMs on local or remote machines. Uses libvirt as the backend
management API.
</_p>
</description>
<screenshots>
<screenshot type="default">
<image>http://virt-manager.org/appdata/en_US/manager.png</image>
<_caption>Main manager window</_caption>
</screenshot>
<screenshot>
<image>http://virt-manager.org/appdata/en_US/details.png</image>
<_caption>Virtual machine configuration screen</_caption>
</screenshot>
<screenshot>
<image>http://virt-manager.org/appdata/en_US/console.png</image>
<_caption>Graphical console connection for a virtual vachine</_caption>
</screenshot>
</screenshots>
<url type="homepage">http://www.virt-manager.org/</url>
<url type="bugtracker">https://bugzilla.redhat.com/enter_bug.cgi?product=Virtualization%20Tools&amp;component=virt-manager</url>
<update_contact>virt-tools-list@redhat.com</update_contact>
<translation type="gettext">virt-manager</translation>
</component>

View File

@ -24,6 +24,14 @@ sysprefix = distutils.sysconfig.get_config_var("prefix")
# pylint: disable=attribute-defined-outside-init
_desktop_files = [
("share/applications", ["data/virt-manager.desktop.in"]),
]
_appdata_files = [
("share/appdata", ["data/virt-manager.appdata.xml.in"]),
]
def _generate_potfiles_in():
def find(dirname, ext):
ret = []
@ -42,8 +50,12 @@ def _generate_potfiles_in():
potfiles += "\n".join(find("virtconv", "*.py")) + "\n\n"
potfiles += "\n".join(find("virtinst", "*.py")) + "\n\n"
for ignore, filelist in _desktop_files + _appdata_files:
potfiles += "\n".join(filelist) + "\n"
potfiles += "\n"
potfiles += "\n".join(["[type: gettext/glade]" + f for
f in find("ui", "*.ui")])
f in find("ui", "*.ui")]) + "\n\n"
return potfiles
@ -75,13 +87,8 @@ class my_build_i18n(distutils.command.build.build):
def _run(self):
# Borrowed from python-distutils-extra
desktop_files = [
("share/applications", ["data/virt-manager.desktop.in"]),
("share/appdata", ["data/virt-manager.appdata.xml"]),
]
po_dir = "po"
# Update po(t) files and print a report
# We have to change the working dir to the po dir for intltool
cmd = ["intltool-update",
@ -112,7 +119,8 @@ class my_build_i18n(distutils.command.build.build):
self.distribution.data_files.append((targetpath, (mo_file,)))
# merge .in with translation
for (file_set, switch) in [(desktop_files, "-d")]:
for (file_set, switch) in [(_desktop_files, "-d"),
(_appdata_files, "-x")]:
for (target, files) in file_set:
build_target = os.path.join("build", target)
if not os.path.exists(build_target):