mail[Wesnoth-commits] r34316 - /trunk/data/tools/wmlxgettext


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on March 31, 2009 - 01:59:
Author: esr
Date: Tue Mar 31 01:59:05 2009
New Revision: 34316

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34316&view=rev
Log:
Speed up and improve parsing.

Modified:
    trunk/data/tools/wmlxgettext

Modified: trunk/data/tools/wmlxgettext
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlxgettext?rev=34316&r1=34315&r2=34316&view=diff
==============================================================================
--- trunk/data/tools/wmlxgettext (original)
+++ trunk/data/tools/wmlxgettext Tue Mar 31 01:59:05 2009
@@ -99,13 +99,14 @@
         attributes_stack = []
         translatables = []
         contexts = {}
-        find_translatable = re.compile('_ *"[^"]*"')
+        find_translatable = re.compile('_ *"([^"]*)"')
 
         def get_translatables(nav, fn):
             "Mine translatable strings "
-            for match in find_translatable.findall(nav.text):
+            itor = find_translatable.finditer(nav.text)
+            for match in itor:
                 opener_stack.append((nav.element, fn, nav.lineno))
-                translatables.append((match, opener_stack[:]))
+                translatables.append((match.group(1), opener_stack[:]))
                 opener_stack.pop()
 
         def inMacroContinuation(nav):
@@ -163,7 +164,7 @@
                     belongs_to = lines[0].split()[1]
                     if belongs_to != domain:
                         if verbose:
-                            print "wmlgettext: skipping %s, wrong domain" % 
fn
+                            print "wmlxgettext: skipping %s, wrong domain" % 
fn
                         continue
                 for nav in WmllintIterator(lines, fn):
                     handle_element(nav, fn)




Related Messages


Powered by MHonArc, Updated Tue Mar 31 03:00:27 2009