r8189 - in people: . jorda

Sylvain Beucler beuc at beuc.net
Mon Sep 22 22:08:38 UTC 2008


Hi,

Just in case, I though I'd mention 'intltool' which provides tools to
work on .desktop files.  The autoconf plugs don't behave exactly as
the gettext ones though (use intltool at compile time, so it goes in
BuildDepends)  :)

-- 
Sylvain

On Mon, Sep 22, 2008 at 09:33:38PM +0000, Jordà Polo wrote:
> 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 at ADDRESS>, YEAR
> +#
> +#, fuzzy
> +msgid ""
> +msgstr ""
> +"Project-Id-Version: pkg-games-desktop 0.1\n"
> +"Report-Msgid-Bugs-To: jorda at ettin.org\n"
> +"POT-Creation-Date: `date +"%F %H:%M%z"`\n"
> +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
> +"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
> +"Language-Team: LANGUAGE <LL at li.org>\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
>    + *



More information about the Pkg-games-devel mailing list