From cf3a1cc1f08a6f1afe9433cf07af1fb931117f2f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 17 Jun 2016 17:31:24 -0400 Subject: [PATCH] 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 --- data/virt-manager.appdata.xml | 25 ----------------------- data/virt-manager.appdata.xml.in | 35 ++++++++++++++++++++++++++++++++ setup.py | 22 +++++++++++++------- 3 files changed, 50 insertions(+), 32 deletions(-) delete mode 100644 data/virt-manager.appdata.xml create mode 100644 data/virt-manager.appdata.xml.in diff --git a/data/virt-manager.appdata.xml b/data/virt-manager.appdata.xml deleted file mode 100644 index e49384c46..000000000 --- a/data/virt-manager.appdata.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - virt-manager.desktop - CC0-1.0 - GPL-2.0+ - Virtual Machine Manager - Graphically manage KVM, Xen, or LXC via libvirt - -

- 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. -

-
- - http://virt-manager.org/appdata/en_US/manager.png - http://virt-manager.org/appdata/en_US/details.png - http://virt-manager.org/appdata/en_US/console.png - - http://www.virt-manager.org/ - virt-tools-list@redhat.com -
diff --git a/data/virt-manager.appdata.xml.in b/data/virt-manager.appdata.xml.in new file mode 100644 index 000000000..94cdcb678 --- /dev/null +++ b/data/virt-manager.appdata.xml.in @@ -0,0 +1,35 @@ + + + virt-manager.desktop + CC0-1.0 + GPL-2.0+ + <_name>Virtual Machine Manager + <_summary>Graphically manage KVM, Xen, or LXC via libvirt + + <_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. + + + + + http://virt-manager.org/appdata/en_US/manager.png + <_caption>Main manager window + + + http://virt-manager.org/appdata/en_US/details.png + <_caption>Virtual machine configuration screen + + + http://virt-manager.org/appdata/en_US/console.png + <_caption>Graphical console connection for a virtual vachine + + + http://www.virt-manager.org/ + https://bugzilla.redhat.com/enter_bug.cgi?product=Virtualization%20Tools&component=virt-manager + virt-tools-list@redhat.com + virt-manager + diff --git a/setup.py b/setup.py index 4d57e788d..d1c9a56ed 100755 --- a/setup.py +++ b/setup.py @@ -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):