Author: jorda-guest
Date: 2008-09-22 21:33:38 +0000 (Mon, 22 Sep 2008)
New Revision: 8189

Added:
   people/jorda/
   people/jorda/xgettextdesktop
Log:
Initial script to extract translatable strings from .desktop files.

Added: people/jorda/xgettextdesktop
===================================================================
--- people/jorda/xgettextdesktop                                (rev 0)
+++ people/jorda/xgettextdesktop        2008-09-22 21:33:38 UTC (rev 8189)
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# Keys such as GenericName are also translatable, but it looks like it is
+# heavily misused. Many desktop files in the pkg-games repos simply use the
+# same string for GenericName and for Name or Exec (which is wrong). See also:
+# http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
+translatable_keys="Comment"
+
+print_msg() {
+       string=$1
+       file=$2
+       comment=$3
+
+       echo ""
+       if [ "$comment" != "" ]; then
+               echo "#. $comment"
+       fi
+       echo "#: $file"
+       echo "msgid \"$string\""
+       echo "msgstr \"\""
+}
+
+cat <<HEADER
+# LANGUAGE translation of Debian Games .desktop files
+# Copyright © `date +%Y` Debian Games Team
+# FIRST AUTHOR <[EMAIL PROTECTED]>, YEAR
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: pkg-games-desktop 0.1\n"
+"Report-Msgid-Bugs-To: [EMAIL PROTECTED]"
+"POT-Creation-Date: `date +"%F %H:%M%z"`\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
+"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+HEADER
+
+for i in `find . -name *.desktop`; do
+       for j in Comment; do
+               msg=`grep "^$j=" $i | sed "s/^$j=//"`
+               if [ "$msg" != "" ]; then
+                       print_msg "$msg" "$i" "$j"
+               fi
+       done
+done


Property changes on: people/jorda/xgettextdesktop
___________________________________________________________________
Name: svn:executable
   + *


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to