diff options
author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-03-15 15:45:36 +0000 |
---|---|---|
committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-03-15 15:45:36 +0000 |
commit | 57545d0789793eb4851d491bdda37e33d7d5834c (patch) | |
tree | 3dc6fdfa68bdec0324016c5a518473e12dcb6410 /utils | |
parent | 4d6aa53ae40b89231bdf7c8af718b937a6667eec (diff) | |
download | sphinx-git-57545d0789793eb4851d491bdda37e33d7d5834c.tar.gz |
Update translations workflow for new ``tx`` client
Diffstat (limited to 'utils')
-rw-r--r-- | utils/babel_runner.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/babel_runner.py b/utils/babel_runner.py index c9d583b1e..5e62efe86 100644 --- a/utils/babel_runner.py +++ b/utils/babel_runner.py @@ -31,8 +31,6 @@ from babel.messages.pofile import read_po, write_po from babel.util import pathmatch from jinja2.ext import babel_extract as extract_jinja2 -import sphinx - ROOT = os.path.realpath(os.path.join(os.path.abspath(__file__), "..", "..")) TEX_DELIMITERS = { 'variable_start_string': '<%=', @@ -75,8 +73,16 @@ KEYWORDS = {**DEFAULT_KEYWORDS, '_': None, '__': None} def run_extract(): """Message extraction function.""" log = _get_logger() + + with open('sphinx/__init__.py', encoding='utf-8') as f: + for line in f.read().splitlines(): + if line.startswith('__version__ = '): + # remove prefix; strip whitespace; remove quotation marks + sphinx_version = line[14:].strip()[1:-1] + break + input_path = 'sphinx' - catalogue = Catalog(project='Sphinx', version=sphinx.__version__, charset='utf-8') + catalogue = Catalog(project='Sphinx', version=sphinx_version, charset='utf-8') base = os.path.abspath(input_path) for root, dirnames, filenames in os.walk(base): |