Skip to content

Commit 835ae0d

Browse files
committed
Hard-linking po files instead of creating symbolic link of the whole directory when building
1 parent dacd52d commit 835ae0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
CPYTHON_CLONE := ../cpython/
1919
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
2020
LANGUAGE := zh_TW
21+
LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
2122
VENV := ~/.venvs/python-docs-i18n/
2223
PYTHON := $(shell which python3)
2324
MODE := autobuild-dev-html
@@ -27,8 +28,9 @@ JOBS = 1
2728

2829
.PHONY: all
2930
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb $(SPHINX_CONF)
30-
mkdir -p $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/
31-
ln -nfs $(shell pwd) $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
31+
mkdir -p $(LC_MESSAGES)
32+
for dirname in $$(find . -name '*.po' | xargs -n1 dirname | sort -u | grep -v '^\.$$'); do mkdir -p $(LC_MESSAGES)/$$dirname; done
33+
for file in *.po */*.po; do ln -f $$file $(LC_MESSAGES)/$$file; done
3234
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE)
3335

3436

0 commit comments

Comments
 (0)