Add some of my utility scripts
[gitphp.git] / util / msgfmt.sh
blob:a/util/msgfmt.sh -> blob:b/util/msgfmt.sh
--- a/util/msgfmt.sh
+++ b/util/msgfmt.sh
@@ -1,1 +1,25 @@
+#!/bin/bash
+#
+# msgfmt.sh
+#
+# Recompiles binary MO files for all languages
+#
+# @author Christopher Han <xiphux@gmail.com>
+# @copyright Copyright (c) 2010 Christopher Han
+# @package GitPHP
+# @package util
+#
 
+LOCALEDIR="locale"
+BUNDLE="gitphp"
+
+for i in "$LOCALEDIR"/*; do
+	if [ -d "$i" ]; then
+		if [ -e "${i}/${BUNDLE}.po" ]; then
+			echo "Building ${i}..."
+			rm -f "${i}/${BUNDLE}.mo"
+			msgfmt -v -o "${i}/${BUNDLE}.mo" "${i}/${BUNDLE}.po"
+		fi
+	fi
+done
+

comments