mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
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.
Github-Pull: #33482
Rebased-From: 7b5261f7ef
This commit is contained in:
@@ -465,18 +465,18 @@ if config.translations_dir:
|
|||||||
sys.stderr.write(f"Error: Could not find translation dir \"{config.translations_dir[0]}\"\n")
|
sys.stderr.write(f"Error: Could not find translation dir \"{config.translations_dir[0]}\"\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print("+ Adding Qt translations +")
|
print("+ Adding Qt translations +")
|
||||||
|
|
||||||
translations = Path(config.translations_dir[0])
|
translations = Path(config.translations_dir[0])
|
||||||
|
|
||||||
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
|
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
|
||||||
|
|
||||||
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
|
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
|
||||||
|
|
||||||
for file in lang_files:
|
for file in lang_files:
|
||||||
if verbose:
|
if verbose:
|
||||||
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
|
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
|
||||||
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
|
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user