From 8abbf82a1e7932bceeec8365926cdbb85f800757 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Sun, 6 Nov 2022 13:42:55 +0000 Subject: [PATCH] check all python files for gettext strings, not just selected ones --- i18n.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/i18n.py b/i18n.py index 2e84c02..0ff2b56 100755 --- a/i18n.py +++ b/i18n.py @@ -27,19 +27,19 @@ import sys import shutil import optparse import subprocess +import glob def make_pot(): print("Make locale/ocitysmap.pot") # TODO auto-generate source file list - subprocess.check_call(['xgettext', '-o', 'ocitysmap.pot', '-p', 'locale', - '-L', 'Python', - 'ocitysmap/indexlib/StreetIndex.py', - 'ocitysmap/indexlib/HealthIndex.py', - 'ocitysmap/indexlib/NotesIndex.py', - 'ocitysmap/indexlib/TreeIndex.py', - 'ocitysmap/layoutlib/multi_page_renderer.py', - 'ocitysmap/layoutlib/single_page_renderers.py', - ]) + cmd = ['xgettext', + '--output=ocitysmap.pot', + '--output-dir=locale', + '--language=Python', + '--from-code=UTF-8', + ] + cmd += glob.glob("./**/*.py", recursive = True) + subprocess.check_call(cmd) return def make_po(languages):