summaryrefslogtreecommitdiff
path: root/scripts/compile-translation.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-04 21:41:54 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-11-04 21:41:54 +0000
commitb6b021385666284d8c99e44c295b7b763ddc9423 (patch)
tree92d8716f082cd20b25c365ccc709ab0282c56c8e /scripts/compile-translation.php
parent36c68d08db7ca5c4fdb7034f5d5f222631afb306 (diff)
downloadsemanticscuttle-b6b021385666284d8c99e44c295b7b763ddc9423.tar.gz
semanticscuttle-b6b021385666284d8c99e44c295b7b763ddc9423.tar.bz2
file to compile translations
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@521 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'scripts/compile-translation.php')
-rw-r--r--scripts/compile-translation.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/compile-translation.php b/scripts/compile-translation.php
new file mode 100644
index 0000000..9d48e69
--- /dev/null
+++ b/scripts/compile-translation.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Compile a translation file from .po to .mo
+ */
+chdir(dirname(dirname(__FILE__)));
+
+if ($argc < 2) {
+ die("pass language name to update, i.e 'de_DE'\n");
+}
+$lang = $argv[1];
+
+$langdir = 'data/locales/' . $lang;
+if (!is_dir($langdir)) {
+ die('There is no language directory: ' . $langdir . "\n");
+}
+
+
+passthru(
+ 'msgfmt --statistics'
+ . ' ' . $langdir . '/LC_MESSAGES/messages.po'
+ . ' -o ' . $langdir . '/LC_MESSAGES/messages.mo'
+);
+
+?> \ No newline at end of file