Skip to content

Commit bf6b7f4

Browse files
committed
Converter for po to mo
Required to run to convert po to machine readable
1 parent 871815b commit bf6b7f4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

web/locale/hst_convert_po2mo.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
if [ ! -e /usr/bin/xgettext ]; then
3+
echo " **********************************************************"
4+
echo " * Unable to find xgettext please install gettext package *"
5+
echo " **********************************************************"
6+
exit 3;
7+
fi
8+
9+
lang=${1-all}
10+
11+
12+
if [ $lang == "all" ]; then
13+
languages=$(ls -d $HESTIA/web/locale/*/ |awk -F'/' '{print $(NF-1)}');
14+
for lang in $languages; do
15+
echo "[ * ] Update $lang "
16+
msgfmt $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.po -o $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.mo
17+
done
18+
else
19+
echo "[ * ] Update $lang "
20+
msgfmt $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.po -o $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.mo
21+
fi
22+

0 commit comments

Comments
 (0)