[geary/wip/l10n-713827: 4/7] Add .pot generation script
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/l10n-713827: 4/7] Add .pot generation script
- Date: Fri, 10 Jan 2014 01:58:12 +0000 (UTC)
commit 2a8cc035314354e380a760b038770585456dc0a1
Author: Charles Lindsay <chaz yorba org>
Date: Thu Jan 9 14:32:06 2014 -0800
Add .pot generation script
po/gen-potfile | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/po/gen-potfile b/po/gen-potfile
new file mode 100755
index 0000000..560b72c
--- /dev/null
+++ b/po/gen-potfile
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+bugs="https://bugzilla.gnome.org/enter_bug.cgi?product=geary"
+header="# geary.pot - PO message string template file for Geary email client
+# Copyright 2012-2014 Yorba Foundation
+# This file is distributed under the GNU LGPL, version 2.1."
+
+dir=`dirname $0`
+
+extract_cmake_set() {
+ grep "^set($1 " "$dir/../CMakeLists.txt" | sed -re 's/^set\([^ ]+ "?([^ ")]+).*$/\1/'
+}
+
+package=`extract_cmake_set GETTEXT_PACKAGE`
+version=`extract_cmake_set VERSION | cut -d. -f-2`
+
+cd "$dir" || exit 1
+intltool-update --pot --gettext-package "$package" || exit 1
+
+sed -i -re 's%(Project-Id-Version:)[^"]+%\1 '"$package-$version"'\\n%' "$package.pot"
+sed -i -re 's%(Report-Msgid-Bugs-To:)[^"]+%\1 '"$bugs"'\\n%' "$package.pot"
+
+tmp=`mktemp`
+: > "$tmp"
+echo "$header" >> "$tmp"
+sed -e '1,4d' "$package.pot" >> "$tmp"
+mv "$tmp" "$package.pot"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]