SF.net SVN: geany-plugins:[1008] trunk/geany-plugins/po

frlan at users.sourceforge.net frlan at xxxxx
Sat Oct 17 08:06:42 UTC 2009


Revision: 1008
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1008&view=rev
Author:   frlan
Date:     2009-10-17 08:06:42 +0000 (Sat, 17 Oct 2009)

Log Message:
-----------
Add intl_stats.sh script

Modified Paths:
--------------
    trunk/geany-plugins/po/ChangeLog

Added Paths:
-----------
    trunk/geany-plugins/po/intl_stats.sh

Modified: trunk/geany-plugins/po/ChangeLog
===================================================================
--- trunk/geany-plugins/po/ChangeLog	2009-10-14 12:57:54 UTC (rev 1007)
+++ trunk/geany-plugins/po/ChangeLog	2009-10-17 08:06:42 UTC (rev 1008)
@@ -1,3 +1,8 @@
+2009-10-17  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
+
+ * intl_stats.sh: Add i18n-stats script copied from Geany.
+
+
 2009-10-12  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * de.po: Update of German translation. Thanks to Dominic Hopf for

Added: trunk/geany-plugins/po/intl_stats.sh
===================================================================
--- trunk/geany-plugins/po/intl_stats.sh	                        (rev 0)
+++ trunk/geany-plugins/po/intl_stats.sh	2009-10-17 08:06:42 UTC (rev 1008)
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+# Little shell script to display some basic statistics about Geany's translation
+# files. It also checks the menu accelerators.
+#
+# Copyright 2007-2008 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+# Copyright 2007-2008 Frank Lanitz <enrico(dot)troeger(at)uvena(dot)de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+check_accelerators=""
+linguas=""
+me=`basename $0`
+
+
+usage()
+{
+	echo "usage: $me [OPTION] [languages...]"
+	echo
+	echo "OPTIONs are:"
+	echo "-h --help           this help screen"
+  	echo "-a --accelerators   check also for menu accelerators"
+  	echo "languages           list of language codes which should be tested"
+  	echo
+  	echo "example: $me -a de fr hu"
+}
+
+
+# parse cmd line arguments
+while [ $# -gt 0 ]
+do
+	case $1 in
+		--accelerators)
+			check_accelerators="--check-accelerators=_"
+			;;
+		-a)
+		  check_accelerators="--check-accelerators=_"
+		  ;;
+		--help)
+		  usage;
+		  exit 1;
+		  ;;
+		-h)
+		  usage;
+		  exit 1;
+		  ;;
+		*)
+		  linguas="$linguas "$1
+		  ;;
+	esac
+	shift
+done
+
+
+
+# if no languages where specified on the command line, take all listed languages in LINGUAS
+if [ -z "$linguas" ]
+then
+	linguas=`sed -e '/^#/d' po/LINGUAS`
+fi
+
+# dash and zsh don't need the -e switch to echo, bash does
+# maybe there is a better way to detect whether we are running on a bash
+eswitch=""
+if [ "$BASH" ]
+then
+	eswitch="-e"
+fi
+
+# do the work
+if [ $check_accelerators ]
+then
+   for lang in $linguas
+   do
+     msgfmt --check --statistics $check_accelerators po/$lang.po;
+   done
+else
+   for lang in $linguas
+   do
+     # maybe the regexp can be optimized, regexps are not my best friends
+     creationdate=`grep "PO-Revision-Date:" po/$lang.po | sed 's/.*: \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}[+|-][0-9]\{4\}\).*/\1/'`
+     echo -n $eswitch $lang"\t("$creationdate"):\t"
+     msgfmt --check --statistics po/$lang.po;
+   done
+fi
+
+


Property changes on: trunk/geany-plugins/po/intl_stats.sh
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list