* src/DateDisplay.py: Allow B.C.E. in years to be localized

* src/dates/Date_de.py: Some more translations including B.C.E.


svn: r4584
This commit is contained in:
Martin Hawlisch 2005-05-13 15:32:58 +00:00
parent e1b74235c1
commit 358208d34f
3 changed files with 25 additions and 5 deletions

View File

@ -12,6 +12,9 @@
* src/plugins/ImportGeneWeb.py: Distinguish unknown people
* src/DateDisplay.py: Allow B.C.E. in years to be localized
* src/dates/Date_de.py: Some more translations including B.C.E.
2005-05-12 Don Allingham <don@gramps-project.org>
* src/GrampsBSDDB.py: force database sync on transaction commit

View File

@ -112,6 +112,8 @@ class DateDisplay:
_qual_str = ("","estimated ","calculated ")
_bce_str = "%s B.C.E."
def __init__(self,format=None):
self.display_cal = [
self._display_gregorian,
@ -172,15 +174,19 @@ class DateDisplay:
return "%s%s%s%s" % (qual_str,self._mod_str[mod],text,self.calendar[cal])
def _slash_year(self,val,slash):
bc = ""
if val < 0:
val = - val
bc = " B.C.E"
# self._bce_str is a localizes string that prints B.C.E. at the apropriate place
format_string = self._bce_str
else:
format_string = "%s"
if slash:
return "%d/%d%s" % (val,(val%10)+1,bc)
year = "%d/%d" % (val,(val%10)+1)
else:
return "%d%s" % (val,bc)
year = "%d" % (val)
return format_string % year
def display_iso(self,date_val):
# YYYY-MM-DD (ISO)

View File

@ -83,23 +83,33 @@ class DateParserDE(DateParser):
u'um' : Date.MOD_ABOUT,
u'etwa' : Date.MOD_ABOUT,
u'circa' : Date.MOD_ABOUT,
u'ca.' : Date.MOD_ABOUT,
}
calendar_to_int = {
u'Gregorianisch' : Date.CAL_GREGORIAN,
u'Greg.' : Date.CAL_GREGORIAN,
u'Julianisch' : Date.CAL_JULIAN,
u'Jul.' : Date.CAL_JULIAN,
u'Hebräisch' : Date.CAL_HEBREW,
u'Hebr.' : Date.CAL_HEBREW,
u'Islamisch' : Date.CAL_ISLAMIC,
u'Französischer Republikaner': Date.CAL_FRENCH,
u'Isl.' : Date.CAL_ISLAMIC,
u'Französisch Republikanisch': Date.CAL_FRENCH,
u'Franz.' : Date.CAL_FRENCH,
u'Persisch' : Date.CAL_PERSIAN,
}
quality_to_int = {
u'geschätzt' : Date.QUAL_ESTIMATED,
u'gesch.' : Date.QUAL_ESTIMATED,
u'errechnet' : Date.QUAL_CALCULATED,
u'berechnet' : Date.QUAL_CALCULATED,
u'ber.' : Date.QUAL_CALCULATED,
}
bce = DateParser.bce + ["vor (unserer|der) Zeit(rechnung)?", "v\. (u|d)\. Z\.", "vor Christus", "vor Christi Geburt", "v\. Chr\."]
def init_strings(self):
DateParser.init_strings(self)
self._span = re.compile("(von|vom)\s+(.+)\s+(bis)\s+(.+)",re.IGNORECASE)
@ -121,6 +131,7 @@ class DateDisplayDE(DateDisplay):
_qual_str = ("",u"geschätzt ",u"errechnet ")
_bce_str = "%s v. u. Z."
formats = (
"JJJJ-MM-DD (ISO)", "Numerisch", "Monat Tag Jahr",