Skip to content

Commit 7b5261f

Browse files
committed
contrib: fix using macdploy script without translations.
QT translations are optional, but the script would error when 'translations_dir' falls back to its default value NULL. This PR fixes it by moving the set-up of QT translations under the check for 'translations_dir' presence.
1 parent 65e909d commit 7b5261f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

contrib/macdeploy/macdeployqtplus

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,18 +460,18 @@ if config.translations_dir:
460460
sys.stderr.write(f"Error: Could not find translation dir \"{config.translations_dir[0]}\"\n")
461461
sys.exit(1)
462462

463-
print("+ Adding Qt translations +")
463+
print("+ Adding Qt translations +")
464464

465-
translations = Path(config.translations_dir[0])
465+
translations = Path(config.translations_dir[0])
466466

467-
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
467+
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
468468

469-
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
469+
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
470470

471-
for file in lang_files:
472-
if verbose:
473-
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
474-
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
471+
for file in lang_files:
472+
if verbose:
473+
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
474+
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
475475

476476
# ------------------------------------------------
477477

0 commit comments

Comments
 (0)