forked from dhis2/dhis2-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_translations.sh
executable file
·87 lines (68 loc) · 3.09 KB
/
build_translations.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#
# Requirements:
#
# ensure language packs are installed. e.g. for French
#> sudo apt-get install language-pack-fr
#
# perform all actions relative to the path of this script
SCRIPT_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$SCRIPT_DIR" ]]; then
SCRIPT_DIR="$PWD"
else
cd $SCRIPT_DIR
SCRIPT_DIR="$PWD"
fi
# include helper functions
. "$SCRIPT_DIR/lib/doc_functions.sh"
# build localised versions
if [ ${LOCALISE} -eq 1 ]; then
# for l in fr,fr_FR pt,pt_PT # this is where you add new languages
for l in fr,fr_FR es_419,es_419 pt,pt_PT cs,cs_CZ
do
lang=${l%,*};
locale=${l#*,};
echo "translating: $lang [ $locale ]";
tmp="$TMPBASE/$lang"
rm -rf $tmp
mkdir -p $tmp
# comment as you wish
# format:
#$> translate <doc name> <chapters subfolder> ["html","pdf","both"]
# mkdir $tmp
cp -a $src/resources/mkdocs/* $tmp/
myml=$tmp/mkdocs.yml
echo " - User:" >> $myml
translate "dhis2_user_manual_en" "user" "both" $lang $locale
translate "dhis2_end_user_manual" "end-user" "both" $lang $locale
translate "dhis2_action_tracker_manual" "at-app" "both" $lang $locale
translate "dhis2_bottleneck_analysis_manual" "bna-app" "both" $lang $locale
translate "dhis2_scorecard_manual" "scorecard-app" "both" $lang $locale
translate "dhis2_who_data_quality_tool_guide" "dq-app" "both" $lang $locale
echo " - Implementer:" >> $myml
translate "dhis2_implementation_guide" "implementer" "both" $lang $locale
translate "dhis2_tracker_implementation_guide" "implementer" "both" $lang $locale
translate "dhis2_android_implementation_guideline" "implementer" "both" $lang $locale
translate "dhis2_android_capture_app" "android-app" "both" $lang $locale
translate "dhis2_android_MDM" "mdm" "both" $lang $locale
translate "user_stories_book" "user-stories" "both" $lang $locale
echo " - Developer:" >> $myml
translate "dhis2_developer_manual" "developer" "both" $lang $locale
echo " DHIS2 API Javadocs: https://docs.dhis2.org/<version>/javadoc/" >> $myml
translate "dhis2_android_sdk_developer_guide" "android-sdk" "both" $lang $locale
echo " - Sysadmin:" >> $myml
translate "dhis2_system_administration_guide" "sysadmin" "both" $lang $locale
echo " - Metadata:" >> $myml
translate "dhis2_who_digital_health_data_toolkit" "metadata" "both" $lang $locale
translate "dhis2_COD" "packages" "both" $lang $locale
translate "dhis2_covid19_surveillance" "packages" "both" $lang $locale
translate "dhis2_IDSR" "packages" "both" $lang $locale
translate "dhis2_immunisation" "packages" "both" $lang $locale
translate "dhis2_malaria" "packages" "both" $lang $locale
translate "dhis2_RMNCAH" "packages" "both" $lang $locale
translate "dhis2_tb_surveillance" "packages" "both" $lang $locale
make_mkdocs
translate "dhis2_draft_chapters" "draft" "both" $lang $locale
done
fi
# rm -rf $TMPBASE