File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Pull catalog message files from Transifex
3+
4+ [ -n " $GITHUB_ACTIONS " ] && set -x
5+ set -e
6+
7+ # Allow language being passed as 1st argument, defaults to pt_BR
8+ LANGUAGE=${1:- pt_BR}
9+
10+ ROOTDIR=$( dirname $0 ) /..
11+
12+ cd ${ROOTDIR}
13+
14+ if ! test -f cpython/Doc/conf.py; then
15+ echo Unable to find proper CPython Doc folder
16+ exit 1
17+ fi
18+
19+ # Create POT Files
20+ cd cpython/Doc
21+ sphinx-build -E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot
22+
23+ # Update CPython's .tx/config
24+ cd locales
25+ sphinx-intl create-txconfig
26+ sphinx-intl update-txconfig-resources -p pot -d . --transifex-project-name python-newest
27+
28+ # Update the translation project's .tx/config
29+ cd ../../.. # back to $ROOTDIR
30+ mkdir -p .tx
31+ sed cpython/Doc/locales/.tx/config \
32+ -e ' /^source_file/d' \
33+ -e ' s|<lang>/LC_MESSAGES/||' \
34+ -e " s|^file_filter|trans.${LANGUAGE} |" \
35+ > .tx/config
36+
37+ tx pull -l ${LANGUAGE} --use-git-timestamps --parallel
You can’t perform that action at this time.
0 commit comments