File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,9 @@ build_docs:
208208 - docs/zh_CN/_build/html
209209 expire_in : 1 mos
210210 script :
211- - cd docs/en
211+ - cd docs
212+ - ./check_lang_folder_sync.sh
213+ - cd en
212214 - make gh-linkcheck
213215 - make html
214216 - ../check_doc_warnings.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # Check if folders with localized documentation are in sync
4+ #
5+ # 1. Traverse each folder with language version and generate a sorted list
6+ # of all the files inside
7+ # 2. Compare the sorted lists of files and flag differences
8+ #
9+ # Note:
10+ # All differences between folders with language versions should be resolved
11+ # before releasing documentation
12+ #
13+
14+ RESULT=0
15+ STARS=' ***************************************************'
16+
17+ find en -type f | cut -d/ -f2- | sort > file_list_en
18+ find zh_CN -type f | cut -d/ -f2- | sort > file_list_zh_CN
19+
20+ # format is to display new or different filenames
21+ DIFF_FORMAT=" --unchanged-line-format= --old-line-format=[en]:%L --new-line-format=[zh_CN]:%L"
22+
23+ FOLDER_DIFFERENCES=$( diff $DIFF_FORMAT file_list_en file_list_zh_CN)
24+ if ! [ -z " $FOLDER_DIFFERENCES " ]; then
25+ echo " $STARS "
26+ echo " Build failed due to the following differences in 'en' and 'zh_CN' folders:"
27+ echo " $FOLDER_DIFFERENCES "
28+ echo " $STARS "
29+ echo " Please synchronize contents of 'en' and 'zh_CN' folders to contain files with identical names"
30+ RESULT=1
31+ fi
32+
33+ # remove temporary files
34+ rm file_list_en file_list_zh_CN
35+
36+ exit $RESULT
You can’t perform that action at this time.
0 commit comments