]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
file to compile translations
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 4 Nov 2009 21:41:54 +0000 (21:41 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 4 Nov 2009 21:41:54 +0000 (21:41 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@521 b3834d28-1941-0410-a4f8-b48e95affb8f

scripts/compile-translation.php [new file with mode: 0644]

diff --git a/scripts/compile-translation.php b/scripts/compile-translation.php
new file mode 100644 (file)
index 0000000..9d48e69
--- /dev/null
@@ -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