Browse Source

Converter for po to mo

Required to run to convert po to machine readable
Jaap Marcus 5 years ago
parent
commit
bf6b7f4860
1 changed files with 22 additions and 0 deletions
  1. 22 0
      web/locale/hst_convert_po2mo.sh

+ 22 - 0
web/locale/hst_convert_po2mo.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+if [ ! -e /usr/bin/xgettext ]; then 
+    echo " **********************************************************"
+    echo " * Unable to find xgettext please install gettext package *"
+    echo " **********************************************************"
+    exit 3;
+fi
+
+lang=${1-all}
+
+
+if [ $lang == "all" ]; then 
+    languages=$(ls -d $HESTIA/web/locale/*/ |awk -F'/' '{print $(NF-1)}');
+    for lang in $languages; do
+       echo "[ * ] Update $lang "
+       msgfmt $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.po -o $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.mo 
+    done
+else 
+    echo "[ * ] Update $lang "
+    msgfmt $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.po -o $HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.mo
+fi
+