1 diff -uNr gdm-2.2.5.4.orig/gui/acinclude.m4 gdm-2.2.5.4/gui/acinclude.m4
2 --- gdm-2.2.5.4.orig/acinclude.m4 Thu Jan 1 01:00:00 1970
3 +++ gdm-2.2.5.4/acinclude.m4 Tue Dec 2 22:38:16 2003
5 +## xml-i18n-tools.m4 - Configure xml-i18n-tools for the target system. -*-Shell-script-*-
6 +## Copyright (C) 2001 Eazel, Inc.
7 +## Author: Maciej Stachowiak <mjs@noisehavoc.org>
9 +## This program is free software; you can redistribute it and/or modify
10 +## it under the terms of the GNU General Public License as published by
11 +## the Free Software Foundation; either version 2 of the License, or
12 +## (at your option) any later version.
14 +## This program is distributed in the hope that it will be useful, but
15 +## WITHOUT ANY WARRANTY; without even the implied warranty of
16 +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 +## General Public License for more details.
19 +## You should have received a copy of the GNU General Public License
20 +## along with this program; if not, write to the Free Software
21 +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 +## As a special exception to the GNU General Public License, if you
24 +## distribute this file as part of a program that contains a
25 +## configuration script generated by Autoconf, you may include it under
26 +## the same distribution terms that you use for the rest of that program.
28 +AC_DEFUN(XML_I18N_TOOLS_NEWER_THAN_0_9,[ true ])
30 +dnl AC_PROG_XML_I18N_TOOLS([MINIMUM-VERSION [,"G2" if always using --utf8] ])
31 +# serial 1 AC_PROG_XML_I18N_TOOLS
32 +AC_DEFUN(AC_PROG_XML_I18N_TOOLS,
34 + AC_DEFUN(X18T_PFORG1, dnl and -u for G2
35 + ifelse([$2],[G2],[ -u ], [ -p ]))
36 + AC_DEFUN(X18T_XML_KIND,
37 + ifelse([$2],[G2],[ -u ],[ $(XML_I18N_XML_KIND) ]))
38 + AC_DEFUN(X18T_KEYS_KIND,
39 + ifelse([$2],[G2],[ -u ],[ $(XML_I18N_KEYS_KIND) ]))
41 + XML_I18N_MERGE_DESKTOP_RULE='%.desktop: %.desktop.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d -u X18T_PFORG1'
42 +XML_I18N_MERGE_DIRECTORY_RULE='%.directory: %.directory.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d -u X18T_PFORG1'
43 + XML_I18N_MERGE_KEYS_RULE='%.keys: %.keys.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -k X18T_KEYS_KIND'
44 + XML_I18N_MERGE_OAF_RULE='%.oaf: %.oaf.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -p'
45 + XML_I18N_MERGE_PONG_RULE='%.pong: %.pong.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_PFORG1'
46 + XML_I18N_MERGE_SERVER_RULE='%.server: %.server.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -u'
47 + XML_I18N_MERGE_SHEET_RULE='%.sheet: %.sheet.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x -u'
48 +XML_I18N_MERGE_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d X18T_PFORG1'
49 + XML_I18N_MERGE_XML_RULE='%.xml: %.xml.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_XML_KIND'
51 +AC_SUBST(XML_I18N_MERGE_DESKTOP_RULE)
52 +AC_SUBST(XML_I18N_MERGE_DIRECTORY_RULE)
53 +AC_SUBST(XML_I18N_MERGE_KEYS_RULE)
54 +AC_SUBST(XML_I18N_MERGE_OAF_RULE)
55 +AC_SUBST(XML_I18N_MERGE_PONG_RULE)
56 +AC_SUBST(XML_I18N_MERGE_SERVER_RULE)
57 +AC_SUBST(XML_I18N_MERGE_SHEET_RULE)
58 +AC_SUBST(XML_I18N_MERGE_SOUNDLIST_RULE)
59 +AC_SUBST(XML_I18N_MERGE_XML_RULE)
61 +# Use the tools built into the package, not the ones that are installed.
63 +XML_I18N_EXTRACT='$(top_builddir)/xml-i18n-extract'
64 +AC_SUBST(XML_I18N_EXTRACT)dnl
66 +XML_I18N_MERGE='$(top_builddir)/xml-i18n-merge'
67 +AC_SUBST(XML_I18N_MERGE)dnl
69 +XML_I18N_UPDATE='$(top_builddir)/xml-i18n-update'
70 +AC_SUBST(XML_I18N_UPDATE)dnl
72 +AC_PATH_PROG(INTLTOOL_PERL, perl)
73 +if test -z "$INTLTOOL_PERL"; then
74 + AC_MSG_ERROR([perl not found; required for xml-i18n-tools])
76 +if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
77 + AC_MSG_ERROR([perl 5.x required for xml-i18n-tools])
80 +dnl Remove Intltool [] tags from po/POTFILES
82 +ifdef([AC_DIVERSION_ICMDS],[
83 + AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
85 + mv -f po/POTFILES po/POTFILES.tmp
86 + sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
87 + rm -f po/POTFILES.tmp
91 + ifdef([AC_CONFIG_COMMANDS_PRE],[
92 + AC_CONFIG_COMMANDS_PRE([
94 + mv -f po/POTFILES po/POTFILES.tmp
95 + sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
96 + rm -f po/POTFILES.tmp
102 +dnl manually sed perl in so people don't have to put the xml-i18n-tools scripts in their
104 +AC_OUTPUT_COMMANDS([
105 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-extract.in > xml-i18n-extract.out
106 +if cmp -s xml-i18n-extract xml-i18n-extract.out 2>/dev/null; then
107 + rm -f xml-i18n-extract.out
109 + mv -f xml-i18n-extract.out xml-i18n-extract
111 +chmod ugo+x xml-i18n-extract
112 +chmod u+w xml-i18n-extract
114 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-merge.in > xml-i18n-merge.out
115 +if cmp -s xml-i18n-merge xml-i18n-merge.out 2>/dev/null; then
116 + rm -f xml-i18n-merge.out
118 + mv -f xml-i18n-merge.out xml-i18n-merge
120 +chmod ugo+x xml-i18n-merge
121 +chmod u+w xml-i18n-merge
123 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-update.in > xml-i18n-update.out
124 +if cmp -s xml-i18n-update xml-i18n-update.out 2>/dev/null; then
125 + rm -f xml-i18n-update.out
127 + mv -f xml-i18n-update.out xml-i18n-update
129 +chmod ugo+x xml-i18n-update
130 +chmod u+w xml-i18n-update
131 +], INTLTOOL_PERL=${INTLTOOL_PERL})
133 +# Redirect the config.log output again, so that the ltconfig log is not
134 +# clobbered by the next message.
135 +exec 5>>./config.log
139 +AC_DEFUN(AM_PROG_XML_I18N_TOOLS, [indir([AC_PROG_XML_I18N_TOOLS])])dnl
140 +# Configure paths for ESD
141 +# Manish Singh 98-9-30
142 +# stolen back from Frank Belew
143 +# stolen from Manish Singh
144 +# Shamelessly stolen from Owen Taylor
146 +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
147 +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
149 +AC_DEFUN(AM_PATH_ESD,
151 +dnl Get the cflags and libraries from the esd-config script
153 +AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
154 + esd_prefix="$withval", esd_prefix="")
155 +AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
156 + esd_exec_prefix="$withval", esd_exec_prefix="")
157 +AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
158 + , enable_esdtest=yes)
160 + if test x$esd_exec_prefix != x ; then
161 + esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
162 + if test x${ESD_CONFIG+set} != xset ; then
163 + ESD_CONFIG=$esd_exec_prefix/bin/esd-config
166 + if test x$esd_prefix != x ; then
167 + esd_args="$esd_args --prefix=$esd_prefix"
168 + if test x${ESD_CONFIG+set} != xset ; then
169 + ESD_CONFIG=$esd_prefix/bin/esd-config
173 + AC_PATH_PROG(ESD_CONFIG, esd-config, no)
174 + min_esd_version=ifelse([$1], ,0.2.5,$1)
175 + AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
177 + if test "$ESD_CONFIG" = "no" ; then
180 + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
181 + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
183 + esd_major_version=`$ESD_CONFIG $esd_args --version | \
184 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
185 + esd_minor_version=`$ESD_CONFIG $esd_args --version | \
186 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
187 + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
188 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
189 + if test "x$enable_esdtest" = "xyes" ; then
190 + ac_save_CFLAGS="$CFLAGS"
191 + ac_save_LIBS="$LIBS"
192 + CFLAGS="$CFLAGS $ESD_CFLAGS"
193 + LIBS="$LIBS $ESD_LIBS"
195 +dnl Now check if the installed ESD is sufficiently new. (Also sanity
196 +dnl checks the results of esd-config to some extent
206 +my_strdup (char *str)
212 + new_str = malloc ((strlen (str) + 1) * sizeof(char));
213 + strcpy (new_str, str);
223 + int major, minor, micro;
226 + system ("touch conf.esdtest");
228 + /* HP/UX 9 (%@#!) writes to sscanf strings */
229 + tmp_version = my_strdup("$min_esd_version");
230 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
231 + printf("%s, bad version string\n", "$min_esd_version");
235 + if (($esd_major_version > major) ||
236 + (($esd_major_version == major) && ($esd_minor_version > minor)) ||
237 + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
243 + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
244 + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
245 + printf("*** best to upgrade to the required version.\n");
246 + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
247 + printf("*** to point to the correct copy of esd-config, and remove the file\n");
248 + printf("*** config.cache before re-running configure\n");
253 +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
254 + CFLAGS="$ac_save_CFLAGS"
255 + LIBS="$ac_save_LIBS"
258 + if test "x$no_esd" = x ; then
260 + ifelse([$2], , :, [$2])
263 + if test "$ESD_CONFIG" = "no" ; then
264 + echo "*** The esd-config script installed by ESD could not be found"
265 + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
266 + echo "*** your path, or set the ESD_CONFIG environment variable to the"
267 + echo "*** full path to esd-config."
269 + if test -f conf.esdtest ; then
272 + echo "*** Could not run ESD test program, checking why..."
273 + CFLAGS="$CFLAGS $ESD_CFLAGS"
274 + LIBS="$LIBS $ESD_LIBS"
279 + [ echo "*** The test program compiled, but did not run. This usually means"
280 + echo "*** that the run-time linker is not finding ESD or finding the wrong"
281 + echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
282 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
283 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
284 + echo "*** is required on your system"
286 + echo "*** If you have an old version installed, it is best to remove it, although"
287 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
288 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
289 + echo "*** exact error that occured. This usually means ESD was incorrectly installed"
290 + echo "*** or that you have moved ESD since it was installed. In the latter case, you"
291 + echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
292 + CFLAGS="$ac_save_CFLAGS"
293 + LIBS="$ac_save_LIBS"
298 + ifelse([$3], , :, [$3])
300 + AC_SUBST(ESD_CFLAGS)
304 diff -ur gdm-2.2.5.4.orig/gui/gdmconfig.desktop.in gdm-2.2.5.4/gui/gdmconfig.desktop.in
305 --- gdm-2.2.5.4.orig/gui/gdmconfig.desktop.in Thu May 3 22:22:22 2001
306 +++ gdm-2.2.5.4/gui/gdmconfig.desktop.in Fri Jan 2 15:19:42 2004
315 +# vi: encoding=utf-8
316 diff -ur gdm-2.2.5.4.orig/gui/gdmflexiserver-xnest.desktop.in gdm-2.2.5.4/gui/gdmflexiserver-xnest.desktop.in
317 --- gdm-2.2.5.4.orig/gui/gdmflexiserver-xnest.desktop.in Sun Aug 19 03:15:09 2001
318 +++ gdm-2.2.5.4/gui/gdmflexiserver-xnest.desktop.in Fri Jan 2 15:19:37 2004
321 Exec=gdmflexiserver --xnest
327 +# vi: encoding=utf-8
328 diff -ur gdm-2.2.5.4.orig/gui/gdmflexiserver.desktop.in gdm-2.2.5.4/gui/gdmflexiserver.desktop.in
329 --- gdm-2.2.5.4.orig/gui/gdmflexiserver.desktop.in Wed Aug 22 14:06:11 2001
330 +++ gdm-2.2.5.4/gui/gdmflexiserver.desktop.in Fri Jan 2 15:19:40 2004
332 _Comment=Log in as another user without loging out
339 +# vi: encoding=utf-8
340 diff -ur gdm-2.2.5.4.orig/gui/gdmphotosetup.desktop.in gdm-2.2.5.4/gui/gdmphotosetup.desktop.in
341 --- gdm-2.2.5.4.orig/gui/gdmphotosetup.desktop.in Fri May 18 00:43:06 2001
342 +++ gdm-2.2.5.4/gui/gdmphotosetup.desktop.in Fri Jan 2 15:19:43 2004
344 TryExec=gdmphotosetup
351 +# vi: encoding=utf-8
352 diff -ur gdm-2.2.5.5/xml-i18n-extract.in~ gdm-2.2.5.5/xml-i18n-extract.in
353 --- gdm-2.2.5.5/xml-i18n-extract.in~ Sat Jan 3 15:21:06 2004
354 +++ gdm-2.2.5.5/xml-i18n-extract.in Sat Jan 3 15:21:06 2004
356 -#!@XML_I18N_TOOLS_PERL@ -w
357 +#!@INTLTOOL_PERL@ -w
358 # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
361 -# The XML Translation Extractor
362 +# The Intltool Message Extractor
364 -# Copyright (C) 2000 Free Software Foundation.
365 +# Copyright (C) 2000-2001 Free Software Foundation.
367 -# This library is free software; you can redistribute it and/or
368 +# Intltool is free software; you can redistribute it and/or
369 # modify it under the terms of the GNU General Public License as
370 # published by the Free Software Foundation; either version 2 of the
371 # License, or (at your option) any later version.
373 -# This script is distributed in the hope that it will be useful,
374 +# Intltool is distributed in the hope that it will be useful,
375 # but WITHOUT ANY WARRANTY; without even the implied warranty of
376 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
377 # General Public License for more details.
379 # You should have received a copy of the GNU General Public License
380 -# along with this library; if not, write to the Free Software
381 +# along with this program; if not, write to the Free Software
382 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
384 +# As a special exception to the GNU General Public License, if you
385 +# distribute this file as part of a program that contains a
386 +# configuration script generated by Autoconf, you may include it under
387 +# the same distribution terms that you use for the rest of that program.
389 # Authors: Kenneth Christiansen <kenneth@gnu.org>
390 -# Darin Adler <darin@eazel.com>
391 +# Darin Adler <darin@bentspoon.com>
394 ## Release information
395 -my $PROGRAM = "xml-i18n-extract";
396 -my $PACKAGE = "xml-i18n-tools";
397 -my $VERSION = "0.9";
398 +my $PROGRAM = "intltool-extract";
399 +my $PACKAGE = "intltool";
400 +my $VERSION = "0.11.1";
402 ## Script options - Enable by setting value to 1
403 -my $ENABLE_INI = "1"; ## desktop and alike files
404 -my $ENABLE_KEYS = "1"; ## mimetype descriptions
405 -my $ENABLE_GLADE = "1"; ## glade files
406 -my $ENABLE_XML = "1"; ## generic xml files
407 +my $ENABLE_INI = "1"; ## desktop and alike files
408 +my $ENABLE_KEYS = "1"; ## mimetype descriptions
409 +my $ENABLE_GLADE = "1"; ## glade files
410 +my $ENABLE_XML = "1"; ## generic xml files
411 +my $ENABLE_SCHEME = "1"; ## scheme files
419 +## Use this instead of \w for XML files to handle more possible characters.
420 +my $w = "[-A-Za-z0-9._:]";
422 ## Always print first
427 "type=s" => \$TYPE_ARG,
428 "local|l" => \$LOCAL_ARG,
429 - "help|h|?" => \$HELP_ARG,
430 + "help|h" => \$HELP_ARG,
431 "version|v" => \$VERSION_ARG,
432 "update" => \$UPDATE_ARG,
433 "quiet|q" => \$QUIET_ARG,
436 ## Sub for printing error messages
438 -# print "xml-i18n-extract: invalid option @ARGV\n";
439 print "Try `${PROGRAM} --help' for more information.\n";
450 @@ -219,12 +228,16 @@
452 if ($gettext_type eq "xml"){
454 - while ($input =~ /[\t\n\s]_\w+=\"([^\"]+)\"/sg) {
455 + while ($input =~ /[\t\n\s]_$w+=\"([^\"]+)\"/sg) {
459 - while ($input =~ /<_(\w+)>([^<]+)<\/_\1>/sg) {
460 - $messages{$2} = [];
461 + while ($input =~ /<_($w+)>([^<]+)<\/_\1>/sg) {
466 + $messages{$_} = [];
471 if ($gettext_type eq "glade"){
473 my $translate = "label|title|text|format|copyright|comments|
474 - preview_text|tooltip";
475 + preview_text|tooltip|message";
477 while ($input =~ /<($translate)>([^<]+)<\/($translate)>/sg) {
485 + if ($ENABLE_SCHEME) {
487 + ### For translatable scheme files ###
489 + if ($gettext_type eq "scheme"){
491 + while ($input =~ /_\(?"((?:[^"\\]+|\\.)*)"\)?/sg) {
492 + $messages{$1} = [];
500 foreach my $message (sort keys %messages) {
501 diff -ur gdm-2.2.5.5/xml-i18n-merge.in~ gdm-2.2.5.5/xml-i18n-merge.in
502 --- gdm-2.2.5.5/xml-i18n-merge.in~ Sat Jan 3 15:21:07 2004
503 +++ gdm-2.2.5.5/xml-i18n-merge.in Sat Jan 3 15:21:07 2004
505 -#!@XML_I18N_TOOLS_PERL@ -w
506 +#!@INTLTOOL_PERL@ -w
509 -# The XML Translation Merge Tool
510 +# The Intltool Message Merger
512 # Copyright (C) 2000 Free Software Foundation.
513 # Copyright (C) 2000, 2001 Eazel, Inc
515 -# This library is free software; you can redistribute it and/or
516 +# Intltool is free software; you can redistribute it and/or
517 # modify it under the terms of the GNU General Public License as
518 # published by the Free Software Foundation; either version 2 of the
519 # License, or (at your option) any later version.
521 -# This script is distributed in the hope that it will be useful,
522 +# Intltool is distributed in the hope that it will be useful,
523 # but WITHOUT ANY WARRANTY; without even the implied warranty of
524 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
525 # General Public License for more details.
527 # You should have received a copy of the GNU General Public License
528 -# along with this library; if not, write to the Free Software
529 +# along with this program; if not, write to the Free Software
530 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
532 -# Authors: Maciej Stachowiak <mjs@eazel.com>
533 +# As a special exception to the GNU General Public License, if you
534 +# distribute this file as part of a program that contains a
535 +# configuration script generated by Autoconf, you may include it under
536 +# the same distribution terms that you use for the rest of that program.
538 +# Authors: Maciej Stachowiak <mjs@noisehavoc.org>
539 # Kenneth Christiansen <kenneth@gnu.org>
540 -# Darin Adler <darin@eazel.com>
541 +# Darin Adler <darin@bentspoon.com>
543 +# Proper XML UTF-8ification written by Cyrille Chepelov <chepelov@calixo.net>
547 ## Release information
548 -my $PROGRAM = "xml-i18n-merge";
549 -my $PACKAGE = "xml-i18n-tools";
550 -my $VERSION = "0.9";
551 +my $PROGRAM = "intltool-merge";
552 +my $PACKAGE = "intltool";
553 +my $VERSION = "0.11.1";
555 ## Script options - Enable by setting value to 1
556 my $ENABLE_XML = "1";
560 ## Scalars used by the option stuff
563 my $VERSION_ARG = "0";
564 my $OAF_STYLE_ARG = "0";
565 my $XML_STYLE_ARG = "0";
566 my $KEYS_STYLE_ARG = "0";
567 my $DESKTOP_STYLE_ARG = "0";
570 +my $PASS_THROUGH_ARG = "0";
575 - "help|h|?" => \$HELP_ARG,
576 + "help|h" => \$HELP_ARG,
577 "version|v" => \$VERSION_ARG,
578 "quiet|q" => \$QUIET_ARG,
579 "oaf-style|o" => \$OAF_STYLE_ARG,
580 "xml-style|x" => \$XML_STYLE_ARG,
581 "keys-style|k" => \$KEYS_STYLE_ARG,
582 - "desktop-style|d" => \$DESKTOP_STYLE_ARG
583 + "desktop-style|d" => \$DESKTOP_STYLE_ARG,
584 + "pass-through|p" => \$PASS_THROUGH_ARG,
585 + "utf8|u" => \$UTF8_ARG
590 my %po_files_by_lang = ();
591 my %translations = ();
593 +# Use this instead of \w for XML files to handle more possible characters.
594 +my $w = "[-A-Za-z0-9._:]";
605 } elsif ($HELP_ARG) {
607 } elsif ($OAF_STYLE_ARG && @ARGV > 2) {
610 &oaf_merge_translations;
611 } elsif ($XML_STYLE_ARG && @ARGV > 2) {
612 + &utf8_sanity_check;
616 &xml_merge_translations;
617 } elsif ($KEYS_STYLE_ARG && @ARGV > 2) {
618 + &utf8_sanity_check;
626 +sub utf8_sanity_check {
628 + if (!$PASS_THROUGH_ARG) {
629 + $PASS_THROUGH_ARG="1";
636 @@ -136,16 +157,18 @@
637 print " -q, --quiet quiet mode\n";
638 print " -o, --oaf-style includes translations in the oaf style\n";
639 print " -x, --xml-style includes translations in the xml style\n";
640 - print " -k, --keys-style includes translations in the keys style\n";
641 + print " -k, --keys-style includes translations in the keys style\n";
642 print " -d, --desktop-style includes translations in the desktop style\n";
643 - print "\nReport bugs to <mjs\@eazel.com>.\n";
644 + print " -u, --utf8 convert all strings to UTF-8 before merging\n";
645 + print " -p, --pass-through use strings as found in .po files, without\n";
646 + print " conversion (STRONGLY unrecommended with -x)\n";
647 + print "\nReport bugs to bugzilla.gnome.org, module intltool or xml-i18n-tools-list\@gnome.org>\n";
652 ## Sub for printing error messages
654 -# print "xml-i18n-merge: invalid option @ARGV\n";
655 print "Try `${PROGRAM} --help' for more information.\n";
665 &create_translation_database;
672 + my ($in_po_file) = @_;
675 + open IN_PO_FILE, $in_po_file;
677 + while (<IN_PO_FILE>) {
678 + ## example: "Content-Type: text/plain; charset=ISO-8859-1\n"
679 + if (/Content-Type\:.*charset=([-a-zA-Z0-9]+)\\n/) {
687 + print ("Warning: no encoding found in $in_po_file. Assuming ISO-8859-1\n");
688 + $encoding = "ISO-8859-1";
693 sub create_translation_database
695 @@ -191,18 +235,23 @@
697 my $po_file = $po_files_by_lang{$lang};
699 - open PO_FILE, "<$po_file";
701 + my $encoding = get_po_encoding($po_file);
702 + open PO_FILE, "iconv -f $encoding -t UTF-8 $po_file|";
704 + open PO_FILE, "<$po_file";
709 $_ = <PO_FILE>; next;
711 if (/^msgid "(.*)"/ ) {
713 + my $msgid = unescape_po_string($1);
716 if (/^msgstr "(.+)"/) {
718 + my $msgstr = unescape_po_string($1);
719 $translations{$lang . "|" . $msgid} = $msgstr;
720 # print "[$lang]$msgstr\n";
726 +sub unescape_one_sequence
728 + my ($sequence) = @_;
730 + return "\\" if $sequence eq "\\\\";
731 + return "\"" if $sequence eq "\\\"";
733 + # gettext also handles \n, \t, \b, \r, \f, \v, \a, \xxx (octal),
734 + # \xXX (hex) and has a comment saying they want to handle \u and \U.
739 +sub unescape_po_string
743 + $string =~ s/(\\.)/unescape_one_sequence($1)/eg;
748 sub lookup_translations
751 @@ -260,16 +331,30 @@
753 my ($pre_encoded) = @_;
755 - $pre_encoded =~ s/\\(.)/$1/g;
756 my @list_of_chars = unpack ('C*', $pre_encoded);
758 - return join ('', map (&entity_encode_int, @list_of_chars));
759 + if ($PASS_THROUGH_ARG) {
760 + return join ('', map (&entity_encode_int_even_high_bit, @list_of_chars));
762 + return join ('', map (&entity_encode_int_minimalist, @list_of_chars));
766 +sub entity_encode_int_minimalist
768 + if ($_ == 34) { return """ }
769 + elsif ($_ == 38) { return "&" }
770 + elsif ($_ == 39) { return "'" }
771 + elsif ($_ == 60) { return "<" }
772 + elsif ($_ == 62) { return ">" }
776 -sub entity_encode_int
777 +sub entity_encode_int_even_high_bit
779 - if ($_ > 127 || $_ == 34 || $_ == 38) {
780 - return "&#" . $_ . ";";
781 + if ($_ > 127 || $_ == 34 || $_ == 38 || $_ == 39 || $_ == 60 || $_ == 62) {
782 + # the ($_ > 127) should probably be removed
783 + return "&#" . $_ . ";";
787 @@ -290,18 +375,18 @@
789 open OUTPUT, ">$OUTFILE";
791 - while ($xml_source =~ /[ \t]*<[^<]*\s_\w+="[^"]*"[^<]*>/m) {
793 + while ($xml_source =~ /[ \t]*<[^<]*\s_$w+="[^"]*"[^<]*>/m) { #"
794 + print OUTPUT $`; #`
797 + $xml_source = $'; #'
799 my $non_translated_line = $orig_node;
800 - $non_translated_line =~ s/_(\w+)="/$1="/;
801 + $non_translated_line =~ s/_($w+)="/$1="/;
803 my $new_node = $non_translated_line;
805 my $value_str = $orig_node;
806 - $value_str =~ s/.*_\w+="([^"]*)".*/$1/s;
807 + $value_str =~ s/.*_$w+="([^"]*)".*/$1/s; #"
810 my %value_translation_map = entity_encode_translations
813 my $translated_line = $orig_node;
814 $translated_line =~ s/name="([^"]*)"/name="$1-$key"/;
815 - $translated_line =~ s/(\s*)_(\w+)="[^"]*"/$1$2="$translation"/;
816 + $translated_line =~ s/(\s*)_($w+)="[^"]*"/$1$2="$translation"/;
818 $new_node .= "\n$translated_line";
820 @@ -345,22 +430,25 @@
822 # First just unmark for translation all empty nodes
823 # for example <_foo/> is just replaced by <foo/>
824 - $xml_source =~ s/<_(\w+)\/>/<$1\/>/mg;
825 + $xml_source =~ s|<_($w+)/>|<$1/>|mg;
827 - # Support for XML <_foo>blah</_foo> style translations
828 - while ($xml_source =~ /([ \t]*)<_(\w+)>([^<]+)<\/_\2>/m) {
829 + # Support for <_foo>blah</_foo> style translations
830 + while ($xml_source =~ m|([ \t]*)<_($w+)>(.*?)</_\2>|s) {
833 + my $remainder = $'; #'
839 my $non_translated_line = "$spaces<$tag_name>$value_str</$tag_name>";
841 my $new_node = $non_translated_line;
844 + $value_str =~ s/\s+/ /g;
845 + $value_str =~ s/^ //;
846 + $value_str =~ s/ $//;
848 my %value_translation_map = entity_encode_translations
849 (lookup_translations ($value_str));
855 - $xml_source = $new_node . $xml_source;
856 + $xml_source = $new_node . $remainder;
859 print OUTPUT $xml_source;
861 sub desktop_merge_translations
863 open INPUT, "<${FILE}";
865 open OUTPUT, ">${OUTFILE}";
868 diff -ur gdm-2.2.5.5/xml-i18n-update.in~ gdm-2.2.5.5/xml-i18n-update.in
869 --- gdm-2.2.5.5/xml-i18n-update.in~ Sat Jan 3 15:21:07 2004
870 +++ gdm-2.2.5.5/xml-i18n-update.in Sat Jan 3 15:21:07 2004
872 -#!@XML_I18N_TOOLS_PERL@ -w
873 +#!@INTLTOOL_PERL@ -w
875 -# The GNOME Translation Update Tool
876 +# The Intltool Message Updater
878 # Copyright (C) 2000 Free Software Foundation.
880 -# This library is free software; you can redistribute it and/or
881 +# Intltool is free software; you can redistribute it and/or
882 # modify it under the terms of the GNU General Public License as
883 # published by the Free Software Foundation; either version 2 of the
884 # License, or (at your option) any later version.
886 -# This script is distributed in the hope that it will be useful,
887 +# Intltool is distributed in the hope that it will be useful,
888 # but WITHOUT ANY WARRANTY; without even the implied warranty of
889 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
890 # General Public License for more details.
892 # You should have received a copy of the GNU General Public License
893 -# along with this library; if not, write to the Free Software
894 +# along with this program; if not, write to the Free Software
895 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
897 +# As a special exception to the GNU General Public License, if you
898 +# distribute this file as part of a program that contains a
899 +# configuration script generated by Autoconf, you may include it under
900 +# the same distribution terms that you use for the rest of that program.
902 # Author(s): Kenneth Christiansen
904 ## Release information
905 -my $PROGRAM = "xml-i18n-update";
906 -my $VERSION = "0.9";
907 -my $_PACKAGE = "xml-i18n-tools";
908 +my $PROGRAM = "intltool-update";
909 +my $VERSION = "0.11.1";
910 +my $_PACKAGE = "intltool";
915 "xml(\.in)*|". # .in is not required
917 "glade(\.in)*|". # .in is not required
918 +"scm(\.in)*|". # .in is not required
929 my $PACKAGE = &find_package_name;
934 - "help|h|?" => \$HELP_ARG,
935 + "help|h" => \$HELP_ARG,
936 "version|v" => \$VERSION_ARG,
937 "dist|d" => \$DIST_ARG,
938 "pot|p" => \$POT_ARG,
940 if ($type =~ /\[type: (gettext\/[^\]].*)]/) {
943 - elsif ($type =~ /(?:xml(\.in)*|ui|oaf(?:\.in)+|pong(?:\.in)+|etspec)$/) {
944 + elsif ($type =~ /(?:xml(\.in)*|ui|oaf(?:\.in)+|server(?:\.in)+|sheet(?:\.in)+|pong(?:\.in)+|etspec)$/) {
945 $gettext_type="gettext\/xml";
947 elsif ($type =~ /glade(\.in)*$/) {
949 elsif ($type =~ /(?:desktop(?:\.in)+|directory(?:\.in)+|soundlist(?:\.in)+)$/) {
950 $gettext_type="gettext\/ini";
952 + elsif ($type =~ /scm(\.in)*$/) {
953 + $gettext_type="gettext\/scheme";
955 elsif ($type =~ /keys(\.in)+$/) {
956 $gettext_type="gettext\/keys";
959 find sub { push @buf_i18n_xml, "$File::Find::name" if /\.($xml_extension)$/ }, "..";
961 open(POTFILES, "POTFILES.in") || die "$PROGRAM: there's no POTFILES.in!!!\n";
962 - @buf_potfiles = <POTFILES>;
963 + @buf_potfiles = grep /^[^#]/, <POTFILES>;
965 print "Searching for missing translatable files...\n";
967 @@ -297,17 +307,17 @@
971 - my $XML_I18N_EXTRACT = `which xml-i18n-extract 2>/dev/null`;
972 - chomp $XML_I18N_EXTRACT;
973 + my $EXTRACT = `which intltool-extract 2>/dev/null`;
976 - $XML_I18N_EXTRACT = $ENV{"XML_I18N_EXTRACT"} if $ENV{"XML_I18N_EXTRACT"};
977 + $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
979 ## Generate the .h header files, so we can allow glade and
980 ## xml translation support
981 - if (! -s $XML_I18N_EXTRACT)
984 - print "\n *** The xml-i18n-extract script wasn't found!"
985 - ."\n *** Without this xml-i18n-update can not generate files.\n";
986 + print "\n *** The intltool-extract script wasn't found!"
987 + ."\n *** Without this intltool-update can not generate files.\n";
994 ## Find xml files in POTFILES.in and generate the
995 - ## files with help from the xml-i18n-extract script
996 + ## files with help from the extract script
998 my $gettext_type=&determine_type($1);
1001 my $filename = "../$_";
1004 - system($XML_I18N_EXTRACT, "--update", "--type=$gettext_type", $filename);
1005 + system($EXTRACT, "--update", "--type=$gettext_type", $filename);
1007 - system($XML_I18N_EXTRACT, "--update", "--type=$gettext_type", "--quiet", $filename);
1008 + system($EXTRACT, "--update", "--type=$gettext_type", "--quiet", $filename);
1013 ."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
1015 system("xgettext", "--default-domain\=$PACKAGE", "--directory\=\.\.",
1016 - "--add-comments", "--keyword\=\_", "--keyword\=N\_",
1017 + "--add-comments", "--keyword\=\_", "--keyword\=N\_", "--keyword\=U\_",
1018 "--files-from\=\.\/POTFILES\.in");
1020 system($gettext_test);