Skip to content

Commit e56b498

Browse files
committed
Translate whatsnew/3.12.po
1 parent 5fb4f71 commit e56b498

File tree

2 files changed

+1918
-793
lines changed

2 files changed

+1918
-793
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ endef
3838
export PRINT_HELP_PYSCRIPT # End of python section
3939

4040
CPYTHON_CLONE := ../cpython
41+
# Pin to match CI (ubuntu-latest = 24.04, gettext 0.21) wrapping behavior
42+
POWRAP_IMAGE := python-docs-zh-tw-powrap
4143
VERSION := $(or $(VERSION), 3.14)
4244
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
4345
LANGUAGE := zh_TW
@@ -157,8 +159,20 @@ lint: $(VENV)/bin/sphinx-lint ## Run sphinx-lint
157159
$(VENV)/bin/sphinx-lint --enable default-role
158160

159161
.PHONY: wrap
160-
wrap: ## Run powrap on modified po files
161-
uvx powrap --modified
162+
wrap: ## Run powrap on po files (pass files or defaults to git modified)
163+
@docker image inspect $(POWRAP_IMAGE) > /dev/null 2>&1 || \
164+
docker build -q -t $(POWRAP_IMAGE) - < .powrap.Dockerfile
165+
@args="$(filter-out $@,$(MAKECMDGOALS))"; \
166+
if [ -n "$$args" ]; then \
167+
files="$$args"; \
168+
else \
169+
files=$$({ git diff --name-only -- '*.po'; git diff --name-only --cached -- '*.po'; } | sort -u | tr '\n' ' '); \
170+
fi; \
171+
if [ -n "$$files" ]; then \
172+
docker run --rm -v $$(pwd):/work -w /work $(POWRAP_IMAGE) powrap $$files; \
173+
else \
174+
echo "No modified .po files"; \
175+
fi
162176

163177
# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error)
164178
%:

0 commit comments

Comments
 (0)