From bb63b3cf1ff86e1bc48bbce73b9cf802bd03844e Mon Sep 17 00:00:00 2001
From: Dan Scott <dan@coffeecode.net>
Date: Mon, 9 Apr 2012 09:37:57 -0400
Subject: [PATCH] i18n: Robustify db-seed-i18n.py parsing

Faced with the perplexing use of a space before a comma in
oils_i18n_gettext() keys, db-seed-i18n.py's regex failed. The solution
for a sloppy regex? More powerful regex!

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
---
 build/i18n/scripts/db-seed-i18n.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build/i18n/scripts/db-seed-i18n.py b/build/i18n/scripts/db-seed-i18n.py
index 7f3419461a..990afcc08e 100755
--- a/build/i18n/scripts/db-seed-i18n.py
+++ b/build/i18n/scripts/db-seed-i18n.py
@@ -55,8 +55,8 @@ class SQL(basel10n.BaseL10N):
 
         num = 0
         findi18n = re.compile(r'.*?oils_i18n_gettext\((.*?)\'\)')
-        intkey = re.compile(r'\s*(?P<id>\d+),\s*\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$')
-        textkey = re.compile(r'\s*\'(?P<id>.*?)\',\s*\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$')
+        intkey = re.compile(r'\s*(?P<id>\d+)\s*,\s*\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$')
+        textkey = re.compile(r'\s*\'(?P<id>.*?)\'\s*,\s*\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$')
         serts = dict()
 
         # Iterate through the source SQL grabbing table names and l10n strings
-- 
2.11.0