From 9aa21105d4d5ba821b3b7853bd75353a70eb5875 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Jul 2025 07:32:19 +0530 Subject: [PATCH] Transifex CLI renamed on Arch, sigh --- setup/translations.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup/translations.py b/setup/translations.py index 5a82ba2215..fdcc33f680 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -20,7 +20,7 @@ import tempfile import textwrap import time from collections import defaultdict -from functools import partial +from functools import lru_cache, partial from locale import normalize as normalize_locale from polyglot.builtins import codepoint_to_chr, iteritems @@ -54,6 +54,11 @@ def qt_sources(): ])) +@lru_cache(maxsize=2) +def tx_exe(): + return os.environ.get('TX', shutil.which('tx-cli') or shutil.which('tx') or 'tx') + + class POT(Command): # {{{ description = 'Update the .pot translation template and upload it' @@ -64,7 +69,7 @@ class POT(Command): # {{{ kw['cwd'] = kw.get('cwd', self.TRANSLATIONS) if hasattr(cmd, 'format'): cmd = shlex.split(cmd) - cmd = [os.environ.get('TX', 'tx')] + cmd + cmd = [tx_exe()] + cmd self.info(' '.join(cmd)) return subprocess.check_call(cmd, **kw)