[open-ils-commits] [GIT] Evergreen ILS branch master updated. 89cb470e38b7cc4c0adf4f51810bf63c8b821461
Evergreen Git
git at git.evergreen-ils.org
Thu Aug 10 17:07:48 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 89cb470e38b7cc4c0adf4f51810bf63c8b821461 (commit)
from f32b455a1b0a99333e77044358d2d082bd5a222f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 89cb470e38b7cc4c0adf4f51810bf63c8b821461
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date: Thu Aug 10 12:45:58 2017 -0400
LP#1709932: recognize more strings from oils_i18n_gettext()
This patch makes db-seed-i18n.py more flexible about
where commas between strings in invocations of oils_i18n_gettext()
can appear, reduces the chances that strings fail to be grabbed
for translation. It also improves the error message shown
when parsing errors occur.
To test
-------
[1] Apply patch and run
cd build/i18n && make sql2pot
[2] Verify that no error messages are produced during
this step.
[3] Inspect the changes to po/db.seed/db.seed.pot and
verify that additional strings are added, including
"Item Print Label Font Family".
[4] (optional) Deliberately remove a comma from an
oils_i18n_gettext invocation in 950.data.seed-values.sql
and run make sql2pot again. The error message shoudl
now include the failing chunk of text.
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
diff --git a/build/i18n/scripts/db-seed-i18n.py b/build/i18n/scripts/db-seed-i18n.py
index 7ecd7ce..0528982 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\((.*?)\'\s*\)', re.UNICODE+re.MULTILINE+re.DOTALL)
- intkey = re.compile(r'\s*(?P<id>\d+)\s*,\s*E?\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$', re.UNICODE+re.MULTILINE+re.DOTALL)
- textkey = re.compile(r'\s*\'(?P<id>.*?)\'\s*,\s*E?\'(?P<string>.+?)\',\s*\'(?P<class>.+?)\',\s*\'(?P<property>.+?)$', re.UNICODE+re.MULTILINE+re.DOTALL)
+ intkey = re.compile(r'\s*(?P<id>\d+)\s*,\s*E?\'(?P<string>.+?)\'\s*,\s*\'(?P<class>.+?)\'\s*,\s*\'(?P<property>.+?)$', re.UNICODE+re.MULTILINE+re.DOTALL)
+ textkey = re.compile(r'\s*\'(?P<id>.*?)\'\s*,\s*E?\'(?P<string>.+?)\'\s*,\s*\'(?P<class>.+?)\'\s*,\s*\'(?P<property>.+?)$', re.UNICODE+re.MULTILINE+re.DOTALL)
serts = dict()
# Iterate through the source SQL grabbing table names and l10n strings
@@ -73,7 +73,7 @@ class SQL(basel10n.BaseL10N):
# Otherwise, it must be a text-based primary key parameter
fi18n = textkey.search(parms)
if fi18n is None:
- raise Exception("Cannot parse the source. Empty strings in there?")
+ raise Exception("Cannot parse the source. Empty strings in there? String I cannot parse is %s" % parms)
fq_field = "%s.%s" % (fi18n.group('class'), fi18n.group('property'))
-----------------------------------------------------------------------
Summary of changes:
build/i18n/scripts/db-seed-i18n.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list