forked from Azure/aks-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert-lcg-lcl.sh
35 lines (30 loc) · 934 Bytes
/
convert-lcg-lcl.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
#!/usr/bin/env bash
# DON'T RUN. This script requires PythonLocalizerTool which is not published yet.
# TODO: make PythonLocalizerTool public
set -eo pipefail
langdirs=loc/*
convert_lcl_to_po() {
for dir in $langdirs
do
loc_lang=`basename "$dir"`
translation_lang=`echo $loc_lang | tr - _`
publish/PythonLocalizerTool lcltopo $dir translations/$translation_lang/LC_MESSAGES/ translations/en_US/LC_MESSAGES/en-US/metadata acsengine ""
msgfmt -c -v -o translations/$translation_lang/LC_MESSAGES/acsengine.mo translations/$translation_lang/LC_MESSAGES/acsengine.po
done
}
convert_po_to_lcg() {
publish/PythonLocalizerTool potolcg translations/en_US/LC_MESSAGES acsengine
}
case "${1-}" in
--potolcg)
echo "converting po to lcg..."
convert_po_to_lcg
;;
--lcltopo)
echo "converting lcl to po..."
convert_lcl_to_po
;;
*)
echo $"Usage: $0 {--potolcg|--lcltopo}"
exit 1
esac