[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/utils wmlxgettext
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/utils wmlxgettext |
Date: |
Thu, 25 Nov 2004 05:40:47 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 04/11/25 10:34:47
Modified files:
utils : wmlxgettext
Log message:
fixed wmlxgettext to support multiple strings on a single line
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/utils/wmlxgettext.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: wesnoth/utils/wmlxgettext
diff -u wesnoth/utils/wmlxgettext:1.13 wesnoth/utils/wmlxgettext:1.14
--- wesnoth/utils/wmlxgettext:1.13 Sun Nov 14 22:24:49 2004
+++ wesnoth/utils/wmlxgettext Thu Nov 25 10:34:47 2004
@@ -2,8 +2,6 @@
# FIXME:
# - maybe restrict "ability" matching to unit defs (not yet necessary)
-# - maybe handle some xgettext flags and behaviours to be more
-# predictable to the command-line user
use strict;
use File::Basename;
@@ -28,15 +26,14 @@
# skip comments
next LINE if m/^\s*\#/ and !defined $str;
- if (m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*)\"(.*)$/) {
+ if (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*)\"(.*)/) {
# single-line quoted string
- die "nested string in $file" if defined $str;
push @{$messages{raw2postring($2)}}, "$file:$."
if ($1 ne ''); # ie. translatable
# process remaining of the line
- $_ = $3;
+ $_ = $3 . "\n";
redo LINE;
} elsif (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\s*\"([^\"]*)/) {
@@ -48,7 +45,7 @@
$str = $_;
$line = $.;
- } elsif (m/(.*?)\"(.*)$/) {
+ } elsif (m/(.*?)\"(.*)/) {
# end of multi-line
die "end of string without a start in $file" if !defined $str;
@@ -59,7 +56,7 @@
$str = undef;
# process remaining of the line
- $_ = $2;
+ $_ = $2 . "\n";
redo LINE;
} elsif (defined $str) {