Skip to content

Commit d554fdb

Browse files
committed
Fix Makefile not getting right translation and add clean
1 parent c24aaa1 commit d554fdb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Makefile

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile for French Python Documentation
1+
# Makefile for Chinese (Taiwan) Python Documentation
22
#
33
# Here is what you can do:
44
#
@@ -15,7 +15,7 @@
1515

1616
CPYTHON_CLONE := ../cpython/
1717
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
18-
LANGUAGE := fr
18+
LANGUAGE := zh_TW
1919
VENV := ~/.venvs/python-docs-i18n/
2020
PYTHON := $(shell which python3)
2121
MODE := autobuild-dev-html
@@ -26,12 +26,13 @@ JOBS = 1
2626
.PHONY: all
2727
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb $(SPHINX_CONF)
2828
mkdir -p $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/
29-
ln -nfs $(shell readlink -f .) $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
29+
ln -nfs $(shell pwd) $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
3030
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE)
3131

3232

3333
$(SPHINX_CONF):
3434
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE)
35+
cd $(CPYTHON_CLONE) && git checkout $(BRANCH)
3536

3637

3738
$(VENV)/bin/activate:
@@ -40,7 +41,7 @@ $(VENV)/bin/activate:
4041

4142

4243
$(VENV)/bin/sphinx-build: $(VENV)/bin/activate
43-
. $(VENV)/bin/activate; python3 -m pip install sphinx
44+
. $(VENV)/bin/activate; python3 -m pip install sphinx python-docs-theme
4445

4546

4647
$(VENV)/bin/blurb: $(VENV)/bin/activate
@@ -49,7 +50,7 @@ $(VENV)/bin/blurb: $(VENV)/bin/activate
4950

5051
.PHONY: upgrade_venv
5152
upgrade_venv: $(VENV)/bin/activate
52-
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx blurb
53+
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb
5354

5455

5556
.PHONY: progress
@@ -91,3 +92,8 @@ endif
9192
.PHONY: fuzzy
9293
fuzzy:
9394
for file in *.po */*.po; do echo $$(msgattrib --only-fuzzy --no-obsolete "$$file" | grep -c '#, fuzzy') $$file; done | grep -v ^0 | sort -gr
95+
96+
97+
.PHONY: clean
98+
clean:
99+
rm *.mo */*.mo

0 commit comments

Comments
 (0)