From 1d7204e7d9707e9e9aa77339aa0f8d99a5eee2de Mon Sep 17 00:00:00 2001 From: David Hampton Date: Wed, 5 Dec 2001 00:09:12 +0000 Subject: [PATCH] Fix date problems (ranges, non-english settings) reading from data file. svn: r607 --- gramps/src/Date.py | 11 ++++++++--- gramps/src/GrampsParser.py | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index f7017a203..ae23f5a08 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -101,8 +101,10 @@ class Date: range = 1 normal = 0 - from_str = _("(from|between|bet|bet.)") - to_str = _("(and|to|-)") + # The last part of these two strings must remain untranslated. It + # is required to read saved data from XML. + from_str = _("(from|between|bet|bet.") + "|FROM)" + to_str = _("(and|to|-") + "|TO)" fmt = compile(r"\s*" + from_str + r"\s+(.+)\s+" + to_str + r"\s+(.+)\s*$", IGNORECASE) @@ -333,8 +335,9 @@ class SingleDate: _("after") : after, _("aft.") : after, _("aft") : after, - # And the untranslated versions for backward compatability + # And the untranslated versions for reading saved data from XML. "abt" : about, + "about" : about, "after" : after, "before" : before } @@ -350,6 +353,8 @@ class SingleDate: _("bef\.?") + '|' + \ "abt" + '|' + \ "aft" + '|' + \ + "after" + '|' + \ + "before" + '|' + \ "bef" + ')' start = "^\s*" + modifiers + "?\s*" diff --git a/gramps/src/GrampsParser.py b/gramps/src/GrampsParser.py index 1cfa8d8da..348cd3567 100644 --- a/gramps/src/GrampsParser.py +++ b/gramps/src/GrampsParser.py @@ -411,6 +411,7 @@ class GrampsParser: d.get_start_date().setIsoDate(attrs['start']) d.get_stop_date().setIsoDate(attrs['stop']) + d.range = 1 def start_dateval(self,attrs): if self.ord: