FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-ja/scripts/update.sh at 3.15 · python/python-docs-ja · GitHub
python
python-docs-ja
Repository navigation
Code
Issues
1
(1)
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-ja
/
scripts
/
update.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (28 loc) · 1.2 KB
Breadcrumbs
python-docs-ja
/
scripts
/
update.sh
Copy path
File metadata and controls
38 lines (28 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!
/bin/sh
#
Pull catalog message files from Transifex
[
-n
"
$GITHUB_ACTIONS
"
]
&&
set
-x
set
-e
#
Allow language being passed as 1st argument, defaults to ja
LANGUAGE=
${1
:-
ja}
ROOTDIR=
$(
realpath
"
$(
dirname
"
$0
"
)
/..
"
)
cd
"
${ROOTDIR}
"
if
!
test
-f cpython/Doc/conf.py
;
then
echo
Unable to find proper CPython Doc folder
exit
1
fi
#
Use fresh catalogs so renamed or removed resources cannot survive a prior run.
mkdir -p cpython/Doc/locales
WORKDIR=
$(
mktemp -d
"
${ROOTDIR}
/cpython/Doc/locales/update.XXXXXX
"
)
trap
'
rm -rf "$WORKDIR"
'
EXIT
trap
'
exit 1
'
HUP INT TERM
#
Create POT Files
cd
cpython/Doc
sphinx-build -E -b gettext -D gettext_compact=0 -d
"
${WORKDIR}
/.doctrees
"
.
"
${WORKDIR}
/pot
"
#
Generate a fresh .tx/config from the current POT files.
cd
"
${WORKDIR}
"
sphinx-intl create-txconfig
sphinx-intl update-txconfig-resources -p pot -d
.
--transifex-organization-name python-doc --transifex-project-name python-newest
#
Pull translations into the temporary LANGUAGE/LC_MESSAGES directory.
tx pull -l
"
${LANGUAGE}
"
-t --use-git-timestamps
#
Validate the download before copying catalogs or removing obsolete files.
python
"
${ROOTDIR}
/scripts/translations.py
"
sync
"
${WORKDIR}
"
"
${ROOTDIR}
"
--language
"
${LANGUAGE}
"
Back
|
FazBrowse Home
|
New Git URL