summaryrefslogtreecommitdiff
path: root/import-po
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-28 23:42:08 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-11-28 23:42:08 +0900
commit8ce0e69c2bd73722e175f0768479463663bf22c7 (patch)
tree4223e9cb142d2f2c5978db3ea1a6f93769c41efa /import-po
parent74520b03f86cbe043e594035f229d2079668671c (diff)
Removed PO files from repository
Currently, message translation is done at launchpad. All PO files can be exported from there. The merge process from launchpad is done when new release. First download export file from launchpad And use import-po script to import PO files into po directory.
Diffstat (limited to 'import-po')
-rwxr-xr-ximport-po49
1 files changed, 49 insertions, 0 deletions
diff --git a/import-po b/import-po
new file mode 100755
index 00000000..5eaf6fd4
--- /dev/null
+++ b/import-po
@@ -0,0 +1,49 @@
+#!/bin/sh -e
+
+# Update po files using launchpad-export.tar.gz
+
+WORK_DIR=launchpad-work
+INPUT_TGZ=$1
+PO_DIR=po
+
+if [ -z "$INPUT_TGZ" ]; then
+ echo "Usage: import-po /path/to/launchpad-export.tar.gz"
+ echo "Specify input launchpad-export.tar.gz file"
+ exit 1
+fi
+if [ ! -e "$INPUT_TGZ" ]; then
+ echo "Input file $INPUT_TGZ does not exist"
+ exit 1
+fi
+
+if [ -e "$WORK_DIR" ]; then
+ rm -rf "$WORK_DIR"
+fi
+mkdir "$WORK_DIR"
+echo "Extracting po files from the archive..."
+tar -x -C "$WORK_DIR" -f "$INPUT_TGZ"
+
+echo "Renaming po files..."
+# The directory structure of launchpad-export.tar.gz is a bit
+# strange. It even contains absolute file path. We first gather all
+# files in top level directory.
+mv "$WORK_DIR"/aria2/*.po "$WORK_DIR"
+
+echo -n "en@quot en@boldquot" > "$PO_DIR"/LINGUAS
+for file in `ls "$WORK_DIR"/*.po`; do
+ # First remove useless '\r' in messages
+ sed -i -e 's/\\r//' "$file"
+ bn=`basename "$file"`
+ bn=${bn#aria2-}
+ dst="$PO_DIR"/"$bn"
+ # copy file to po directory
+ echo "Moving \`$file' to \`$dst'..."
+ mv "$file" "$dst"
+ # Upate LINGUAS here too.
+ echo -n " ${bn%.po}" >> "$PO_DIR"/LINGUAS
+done
+
+rm -rf "$WORK_DIR"
+
+cd "$PO_DIR"
+make update-po