summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2020-07-11 18:30:31 -0400
committerCole Robinson <crobinso@redhat.com>2020-07-11 19:18:38 -0400
commit14f8d2ff7a7524992ba934dc1f1af71d39f8f5c3 (patch)
tree09881cf85eb8b5625fbf49fffa9acd88a677d7ca /setup.py
parentfec9f0b13643a3dc8a33c5b23e200ea35ed12dcd (diff)
downloadvirt-manager-14f8d2ff7a7524992ba934dc1f1af71d39f8f5c3.tar.gz
setup: Tweak extract_messages
* Use long xgettext options * Truncate .pot file upfront so every call uses --join-existing Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 4382d6af..9f84159a 100755
--- a/setup.py
+++ b/setup.py
@@ -657,14 +657,19 @@ class ExtractMessages(distutils.core.Command):
def run(self):
bug_address = "https://github.com/virt-manager/virt-manager/issues"
+ potfile = "po/virt-manager.pot"
xgettext_args = [
"xgettext",
- "-F",
"--msgid-bugs-address=" + bug_address,
- "-o", "po/virt-manager.pot",
"--package-name=virt-manager",
+ "--output=" + potfile,
+ "--sort-by-file",
+ "--join-existing",
]
+ # Truncate .pot file to ensure it exists
+ open(potfile, "w").write("")
+
# First extract the messages from the AppStream sources,
# creating the template
appdata_files = [f for sublist in _appdata_files for f in sublist[1]]
@@ -673,20 +678,20 @@ class ExtractMessages(distutils.core.Command):
# Extract the messages from the desktop files
desktop_files = [f for sublist in _desktop_files for f in sublist[1]]
- cmd = xgettext_args + ["-j", "-L", "Desktop"] + desktop_files
+ cmd = xgettext_args + ["--language=Desktop"] + desktop_files
self.spawn(cmd)
# Extract the messages from the Python sources
py_sources = list(Path("virtManager").rglob("*.py"))
py_sources += list(Path("virtinst").rglob("*.py"))
py_sources = [str(src) for src in py_sources]
- cmd = xgettext_args + ["-j", "-L", "Python"] + py_sources
+ cmd = xgettext_args + ["--language=Python"] + py_sources
self.spawn(cmd)
# Extract the messages from the Glade UI files
ui_files = list(Path(".").rglob("*.ui"))
ui_files = [str(src) for src in ui_files]
- cmd = xgettext_args + ["-j", "-L", "Glade"] + ui_files
+ cmd = xgettext_args + ["--language=Glade"] + ui_files
self.spawn(cmd)