summaryrefslogtreecommitdiff
path: root/build/po_functions
diff options
context:
space:
mode:
Diffstat (limited to 'build/po_functions')
-rw-r--r--build/po_functions40
1 files changed, 40 insertions, 0 deletions
diff --git a/build/po_functions b/build/po_functions
new file mode 100644
index 000000000..8079ddb7b
--- /dev/null
+++ b/build/po_functions
@@ -0,0 +1,40 @@
+# Routines used to build manual translations from po-files
+
+update_templates () {
+ echo "Generating integrated XML files and POT files"
+ bash -c "cd .. ; ./scripts/merge_xml en"
+ RET=$?; [ $RET -ne 0 ] && exit 1 || true
+ bash -c "cd .. ; ./scripts/update_pot"
+ RET=$?; [ $RET -ne 0 ] && exit 1 || true
+}
+
+# Check whether language uses PO files for translation
+check_po () {
+ USES_PO=""
+ if [ -d "../po/$lang" ] ; then
+ if [ -d "../$lang/.svn" ] ; then
+ echo "Warning: both PO files and XML files are present; ignoring PO files"
+ else
+ USES_PO="1"
+ if [ -d "../$lang/" ] ; then
+ echo "Info: cleaning old XML files"
+ rm -r ../$lang/
+ fi
+ fi
+ fi
+}
+
+generate_xml () {
+ sh -c "cd ..; ./scripts/update_po $lang"
+ RET=$?; [ $RET -ne 0 ] && return $RET || true
+
+ sh -c "cd ..; ./scripts/create_xml $lang"
+ RET=$?; [ $RET -ne 0 ] && return $RET || true
+
+ echo "Info: generation of XML files complete"
+ return 0
+}
+
+clear_po () {
+ rm -rf ./build.po
+}