From bb63b3cf1ff86e1bc48bbce73b9cf802bd03844e Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 9 Apr 2012 09:37:57 -0400 Subject: [PATCH 1/1] 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 Signed-off-by: Thomas Berezansky --- 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\d+),\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') - textkey = re.compile(r'\s*\'(?P.*?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') + intkey = re.compile(r'\s*(?P\d+)\s*,\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') + textkey = re.compile(r'\s*\'(?P.*?)\'\s*,\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') serts = dict() # Iterate through the source SQL grabbing table names and l10n strings -- 2.43.2