Skip to content

Commit 9c8fbf1

Browse files
committed
Update build and deploy workflow
1 parent bbd73ec commit 9c8fbf1

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,10 @@ jobs:
4141
with:
4242
path: Doc/locales/fa/LC_MESSAGES
4343

44-
- name: Strip stray fuzzy markers
45-
run: python3 Doc/locales/fa/LC_MESSAGES/scripts/strip_fuzzy.py $(find Doc/locales/fa/LC_MESSAGES -name "*.po" -not -path "*/.git/*")
46-
47-
- name: Install gettext
48-
run: sudo apt-get install -y gettext
49-
50-
- name: Compile .po files to .mo
51-
run: |
52-
find Doc/locales/fa/LC_MESSAGES -name "*.po" -not -path "*/.git/*" | while read f; do
53-
msgfmt "$f" -o "${f%.po}.mo"
54-
done
44+
- name: Strip fuzzy markers and compile .po to .mo
45+
run: find Doc/locales/fa/LC_MESSAGES -name "*.po" -not -path "*/.git/*" | python3 Doc/locales/fa/LC_MESSAGES/scripts/compile_mo.py
46+
env:
47+
MSGFMT_TOOLS_PATH: Tools/i18n
5548

5649
- name: Setup problem matcher
5750
uses: sphinx-doc/github-problem-matcher@v1.1

scripts/compile_mo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
import sys
1717
import os
1818

19-
# venv/cpython/Tools/i18n/msgfmt.py, relative to repo root.
20-
sys.path.insert(0, os.path.join("venv", "cpython", "Tools", "i18n"))
19+
_venv_tools = os.environ.get(
20+
"MSGFMT_TOOLS_PATH",
21+
os.path.join("venv", "cpython", "Tools", "i18n"),
22+
)
23+
sys.path.insert(0, _venv_tools)
2124
import msgfmt # noqa: E402
2225

2326

0 commit comments

Comments
 (0)