From 5e3c0acf54f5bbece7a78f928cfc11cc28f04369 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 10 Nov 2020 16:30:25 +0100 Subject: setup.py: Only translate .po files in po/ subdir (ignore e.g. the LINGUAS file). --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 36cd87d..799d8d2 100755 --- a/setup.py +++ b/setup.py @@ -43,17 +43,19 @@ for strRoot, lstDirnames, lstFilenames in os.walk('po'): for strFilename in lstFilenames: - strLocale = os.path.splitext(strFilename)[0] + if strFilename.endswith('.po'): + + strLocale = os.path.splitext(strFilename)[0] - if strLocale != APPNAME: + if strLocale != APPNAME: - strLocaleDir = 'data/locale/' + strLocale + '/LC_MESSAGES/' + strLocaleDir = 'data/locale/' + strLocale + '/LC_MESSAGES/' - if not os.path.isdir(strLocaleDir): + if not os.path.isdir(strLocaleDir): - os.makedirs(strLocaleDir) + os.makedirs(strLocaleDir) - polib.pofile('po/' + strFilename).save_as_mofile(strLocaleDir + APPNAME + '.mo') + polib.pofile('po/' + strFilename).save_as_mofile(strLocaleDir + APPNAME + '.mo') for strRoot, lstDirnames, lstFilenames in os.walk('data'): -- cgit v1.2.3