From 6b3c1258669c1ebb8dd6b00258205c4756be968a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sat, 10 Apr 2010 18:27:43 +0000 Subject: [PATCH] 3756: Cannot set new year value different than default (first January) svn: r15074 --- src/DateHandler/_Date_bg.py | 22 +++++++++++++--------- src/DateHandler/_Date_ca.py | 16 ++++++++++------ src/DateHandler/_Date_cs.py | 16 ++++++++++------ src/DateHandler/_Date_de.py | 16 ++++++++++------ src/DateHandler/_Date_fi.py | 33 ++++++++++++++++++++------------- src/DateHandler/_Date_hr.py | 21 ++++++++++++++------- src/DateHandler/_Date_it.py | 16 ++++++++++------ src/DateHandler/_Date_lt.py | 22 +++++++++++++--------- src/DateHandler/_Date_nb.py | 22 +++++++++++++--------- src/DateHandler/_Date_nl.py | 16 ++++++++++------ src/DateHandler/_Date_pl.py | 16 ++++++++++------ src/DateHandler/_Date_pt.py | 16 ++++++++++------ src/DateHandler/_Date_ru.py | 22 +++++++++++++--------- src/DateHandler/_Date_sk.py | 16 ++++++++++------ src/DateHandler/_Date_sr.py | 16 ++++++++++------ src/DateHandler/_Date_sv.py | 22 +++++++++++++--------- 16 files changed, 189 insertions(+), 119 deletions(-) diff --git a/src/DateHandler/_Date_bg.py b/src/DateHandler/_Date_bg.py index 36031f25b..f0c88fdf6 100644 --- a/src/DateHandler/_Date_bg.py +++ b/src/DateHandler/_Date_bg.py @@ -194,12 +194,12 @@ class DateDisplayBG(DateDisplay): calendar = ( u"", - u" (юлиански)", - u" (еврейски)", - u" (републикански)", - u" (персийски)", - u" (ислямски)", - u" (шведски)" + u"юлиански", + u"еврейски", + u"републикански", + u"персийски", + u"ислямски", + u"шведски" ) _mod_str = ("", "преди ", "след ", "около ", "", "", "") @@ -282,6 +282,7 @@ class DateDisplayBG(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -292,14 +293,17 @@ class DateDisplayBG(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'от', d1, u'до', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'от', d1, u'до', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и', d2, scal) else: text = self.display_cal[date.get_calendar()](start) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_ca.py b/src/DateHandler/_Date_ca.py index e93498355..bf9b672c4 100644 --- a/src/DateHandler/_Date_ca.py +++ b/src/DateHandler/_Date_ca.py @@ -125,9 +125,9 @@ class DateDisplayCA(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ( - "", u" (Julià)", u" (Hebreu)", - u" (Revolucionari)", u" (Persa)", u" (Islàmic)", - u" (Swedish)" + "", u"Julià", u"Hebreu", + u"Revolucionari", u"Persa", u"Islàmic", + u"Swedish" ) _mod_str = ("", u"abans de ", u"després de ", u"cap a ", "", "", "") @@ -164,6 +164,7 @@ class DateDisplayCA(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -174,14 +175,17 @@ class DateDisplayCA(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'des de', d1, u'fins a', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'des de', d1, u'fins a', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'i', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'i', d2, scal) else: text = self.display_cal[date.get_calendar()](start) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_cs.py b/src/DateHandler/_Date_cs.py index f8605d68d..5661d7221 100644 --- a/src/DateHandler/_Date_cs.py +++ b/src/DateHandler/_Date_cs.py @@ -111,9 +111,9 @@ class DateDisplayCZ(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ( - "", u" (juliánský)", u" (hebrejský)", - u" (republikánský)", u" (perský)", u" (islámský)", - u" (swedish)" + "", u"juliánský", u"hebrejský", + u"republikánský", u"perský", u"islámský", + u"swedish" ) _mod_str = ("", u"před ", u"po ", u"kolem ", "", "", "") @@ -133,6 +133,7 @@ class DateDisplayCZ(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -143,17 +144,20 @@ class DateDisplayCZ(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'od', d1, - u'do', d2, self.calendar[cal]) + u'do', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'mezi', - d1, u'a', d2, self.calendar[cal]) + d1, u'a', d2, scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], - text, self.calendar[cal]) + text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_de.py b/src/DateHandler/_Date_de.py index 1a7cef76f..1db47d7d3 100644 --- a/src/DateHandler/_Date_de.py +++ b/src/DateHandler/_Date_de.py @@ -206,9 +206,9 @@ class DateDisplayDE(DateDisplay): u"Jul", u"Aug", u"Sep", u"Okt", u"Nov", u"Dez" ) calendar = ( - "", u" (julianisch)", u" (hebräisch)", - u" (französisch republikanisch)", u" (persisch)", u" (islamisch)", - u" (schwedisch)" + "", u"julianisch", u"hebräisch", + u"französisch republikanisch", u"persisch", u"islamisch", + u"schwedisch" ) _mod_str = ("", u"vor ", u"nach ", u"etwa ", "", "", "") @@ -289,6 +289,7 @@ class DateDisplayDE(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -299,14 +300,17 @@ class DateDisplayDE(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'von', d1, u'bis', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'von', d1, u'bis', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%szwischen %s und %s%s" % (qual_str, d1, d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%szwischen %s und %s%s" % (qual_str, d1, d2, scal) else: text = self.display_cal[date.get_calendar()](start) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_fi.py b/src/DateHandler/_Date_fi.py index 90ef5a938..0dba209b7 100644 --- a/src/DateHandler/_Date_fi.py +++ b/src/DateHandler/_Date_fi.py @@ -125,13 +125,13 @@ class DateDisplayFI(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ("", - u"(juliaaninen)", - u"(heprealainen)", - u"(ranskan v.)", - u"(persialainen)", - u"(islamilainen)", - u" (svensk)" - ) + u"juliaaninen", + u"heprealainen", + u"ranskan v.", + u"persialainen", + u"islamilainen", + u"svensk" + ) _qual_str = (u"", u"arviolta", u"laskettuna") @@ -139,7 +139,7 @@ class DateDisplayFI(DateDisplay): formats = ( "VVVV-KK-PP (ISO)", - "PP.KK.VVVV" + "PP.KK.VVVV" ) def display(self, date): @@ -150,6 +150,7 @@ class DateDisplayFI(DateDisplay): qual = date.get_quality() cal = date.get_calendar() start = date.get_start_date() + newyear = date.get_new_year() if mod == Date.MOD_TEXTONLY: return date.get_text() @@ -162,21 +163,25 @@ class DateDisplayFI(DateDisplay): if mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - text = u"%s - %s" % (d1, d2) + scal = self.format_extras(cal, newyear) + text = u"%s - %s%s" % (d1, d2, scal) elif mod == Date.MOD_RANGE: stop = date.get_stop_date() if start[0] == start[1] == 0 and stop[0] == 0 and stop[1] == 0: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](stop) - text = u"vuosien %s ja %s välillä" % (d1, d2) + scal = self.format_extras(cal, newyear) + text = u"vuosien %s ja %s välillä%s" % (d1, d2, scal) else: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](stop) - text = u"%s ja %s välillä" % (d1, d2) + scal = self.format_extras(cal, newyear) + text = u"%s ja %s välillä%s" % (d1, d2, scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) if mod == Date.MOD_AFTER: - text = text + u" jälkeen" + text = text + u" jälkeen%s" % scal elif mod == Date.MOD_ABOUT: text = u"noin " + text elif mod == Date.MOD_BEFORE: @@ -185,9 +190,11 @@ class DateDisplayFI(DateDisplay): if qual: # prepend quality text = u"%s %s" % (self._qual_str[qual], text) + if cal: # append calendar type - text = u"%s %s" % (text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + text = u"%s %s" % (text, scal) return text diff --git a/src/DateHandler/_Date_hr.py b/src/DateHandler/_Date_hr.py index 04a5506b1..8805996d7 100644 --- a/src/DateHandler/_Date_hr.py +++ b/src/DateHandler/_Date_hr.py @@ -115,6 +115,7 @@ class DateParserHR(DateParser): month_to_int[u"septembar"] = 9 month_to_int[u"septembra"] = 9 month_to_int[u"ix"] = 9 + month_to_int[u"7ber"] = 9 month_to_int[u"listopad"] = 10 month_to_int[u"listopada"] = 10 @@ -122,6 +123,7 @@ class DateParserHR(DateParser): month_to_int[u"oktobar"] = 10 month_to_int[u"oktobra"] = 10 month_to_int[u"x"] = 10 + month_to_int[u"8ber"] = 10 month_to_int[u"studeni"] = 11 month_to_int[u"studenog"] = 11 @@ -129,6 +131,7 @@ class DateParserHR(DateParser): month_to_int[u"novembar"] = 11 month_to_int[u"novembra"] = 11 month_to_int[u"xi"] = 11 + month_to_int[u"9ber"] = 11 month_to_int[u"prosinac"] = 12 month_to_int[u"prosinca"] = 12 @@ -160,7 +163,7 @@ class DateParserHR(DateParser): u'franc.' : Date.CAL_FRENCH, u'perzijski' : Date.CAL_PERSIAN, u'perz. ' : Date.CAL_PERSIAN, - u'swedish' : Date.CAL_SWEDISH, + u'švedski' : Date.CAL_SWEDISH, u's' : Date.CAL_SWEDISH, } @@ -224,9 +227,9 @@ class DateDisplayHR(DateDisplay): ) calendar = ( - "", u" (julijanski)", u" (hebrejski)", - u" (francuski republikanski)", u" (perzijski)", u" (islamski)", - u" (swedish)" + "", u"julijanski", u"hebrejski", + u"francuski republikanski", u"perzijski", u"islamski", + u"swedish" ) _mod_str = ("", "prije ", "poslije ", "okolo ", "", "", "") @@ -319,6 +322,7 @@ class DateDisplayHR(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -329,17 +333,20 @@ class DateDisplayHR(DateDisplay): elif mod == Date.MOD_SPAN: d_1 = self.display_cal[cal](start) d_2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2, - self.calendar[cal]) + scal) elif mod == Date.MOD_RANGE: d_1 = self.display_cal[cal](start) d_2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, - self.calendar[cal]) + scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_it.py b/src/DateHandler/_Date_it.py index 47ae14844..c25b65454 100644 --- a/src/DateHandler/_Date_it.py +++ b/src/DateHandler/_Date_it.py @@ -120,9 +120,9 @@ class DateDisplayIT(DateDisplay): u"lug", u"ago", u"set", u"ott", u"nov", u"dic" ) calendar = ( - "", u" (Giuliano)", u" (Ebraico)", - u" (Rivoluzionario)", u" (Persiano)", u" (Islamico)", - u" (Svedese)" + "", u"Giuliano", u"Ebraico", + u"Rivoluzionario", u"Persiano", u"Islamico", + u"Svedese" ) _mod_str = ("", u"prima del ", u"dopo del ", u"circa il ", "", "", "") @@ -159,6 +159,7 @@ class DateDisplayIT(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -169,14 +170,17 @@ class DateDisplayIT(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'dal', d1, u'al', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'dal', d1, u'al', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'tra', d1, u'e', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'tra', d1, u'e', d2, scal) else: text = self.display_cal[date.get_calendar()](start) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_lt.py b/src/DateHandler/_Date_lt.py index c845dfafb..e77b357c3 100644 --- a/src/DateHandler/_Date_lt.py +++ b/src/DateHandler/_Date_lt.py @@ -110,12 +110,12 @@ class DateDisplayLT(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ( - u"", u" (julijaus)", - u" (hebrajų)", - u" (prancuzų respublikos)", - u" (persų)", - u" (islamo)", - u" (swedish)" + u"", u"julijaus", + u"hebrajų", + u"prancuzų respublikos", + u"persų", + u"islamo", + u"swedish" ) _mod_str = (u"", @@ -139,6 +139,7 @@ class DateDisplayLT(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -149,17 +150,20 @@ class DateDisplayLT(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'nuo', d1, u'iki', - d2, self.calendar[cal]) + d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'tarp', d1, u'ir', - d2, self.calendar[cal]) + d2, scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, - self.calendar[cal]) + scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_nb.py b/src/DateHandler/_Date_nb.py index 7ebd0b04c..2ccf9dce4 100644 --- a/src/DateHandler/_Date_nb.py +++ b/src/DateHandler/_Date_nb.py @@ -124,12 +124,12 @@ class DateDisplayNb(DateDisplay): calendar = ( "", - " (juliansk)", - " (hebraisk)", - " (fransk republikansk)", - " (persisk)", - " (islamisk)", - " (svensk)" + "juliansk", + "hebraisk", + "fransk republikansk", + "persisk", + "islamisk", + "svensk" ) _mod_str = ("", u"før ", u"etter ", u"ca ", "", "", "") @@ -146,6 +146,7 @@ class DateDisplayNb(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -156,16 +157,19 @@ class DateDisplayNb(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return u"%sfra %s til %s%s" % (qual_str, d1, d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return u"%sfra %s til %s%s" % (qual_str, d1, d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return u"%smellom %s og %s%s" % (qual_str, d1, d2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return u"%s%s%s%s" % (qual_str, self._mod_str[mod], - text, self.calendar[cal]) + text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_nl.py b/src/DateHandler/_Date_nl.py index 0bc9e820a..89de87f0f 100644 --- a/src/DateHandler/_Date_nl.py +++ b/src/DateHandler/_Date_nl.py @@ -150,9 +150,9 @@ class DateDisplayNL(DateDisplay): u"jul", u"aug", u"sep", u"okt", u"nov", u"dec" ) calendar = ( - "", u" (juliaans)", u" (hebreeuws)", - u" (franse republiek)", u" (persisch)", u" (islamitisch)", - u" (zweeds)" ) + "", u"juliaans", u"hebreeuws", + u"franse republiek", u"persisch", u"islamitisch", + u"zweeds" ) _mod_str = ("", u"voor ", u"na ", u"rond ", "", "", "") @@ -234,6 +234,7 @@ class DateDisplayNL(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -244,17 +245,20 @@ class DateDisplayNL(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'van', d1, - u'tot', d2, self.calendar[cal]) + u'tot', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%stussen %s en %s%s" % (qual_str, d1, d2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, - self.calendar[cal]) + scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_pl.py b/src/DateHandler/_Date_pl.py index 4cd93c108..04bfdeeec 100644 --- a/src/DateHandler/_Date_pl.py +++ b/src/DateHandler/_Date_pl.py @@ -148,9 +148,9 @@ class DateDisplayPL(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ( - "", u" (juliański)", u" (hebrajski)", - u" (francuski republikański)", u" (perski)", u" (islamski)", - u" (swedish)" + "", u"juliański", u"hebrajski", + u"francuski republikański", u"perski", u"islamski", + u"swedish" ) _mod_str = ("", u"przed ", u"po ", u"ok. ", "", "", "") @@ -246,6 +246,7 @@ class DateDisplayPL(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -256,17 +257,20 @@ class DateDisplayPL(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'od', d1, u'do', d2, - self.calendar[cal]) + scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'między', d1, u'a', d2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, - self.calendar[cal]) + scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_pt.py b/src/DateHandler/_Date_pt.py index aaa1b4178..c0a5e5c86 100644 --- a/src/DateHandler/_Date_pt.py +++ b/src/DateHandler/_Date_pt.py @@ -130,9 +130,9 @@ class DateDisplayPT(DateDisplay): u"Jul", u"Ago", u"Set", u"Out", u"Nov", u"Dez" ) calendar = ( - "", u" (Juliano)", u" (Hebreu)", - u" (Revolucionário)", u" (Persa)", u" (Islâmico)", - u" (Sueco)" + "", u"Juliano", u"Hebreu", + u"Revolucionário", u"Persa", u"Islâmico", + u"Sueco" ) _mod_str = ("",u"antes de ",u"depois de ",u"por volta de ","","","") @@ -152,6 +152,7 @@ class DateDisplayPT(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -162,14 +163,17 @@ class DateDisplayPT(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2,self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'de', d1, u'a', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'e', d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s %s %s %s%s" % (qual_str, u'entre', d1, u'e', d2, scal) else: text = self.display_cal[date.get_calendar()](start) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_ru.py b/src/DateHandler/_Date_ru.py index 6117a9fa7..bddf8615a 100644 --- a/src/DateHandler/_Date_ru.py +++ b/src/DateHandler/_Date_ru.py @@ -197,12 +197,12 @@ class DateDisplayRU(DateDisplay): calendar = ( u"", - u" (юлианский)", - u" (еврейский)", - u" (республиканский)", - u" (персидский)", - u" (исламский)", - u" (Swedish)" + u"юлианский", + u"еврейский", + u"республиканский", + u"персидский", + u"исламский", + u"Swedish" ) _mod_str = ( @@ -291,6 +291,7 @@ class DateDisplayRU(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -301,17 +302,20 @@ class DateDisplayRU(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%sс %s %s %s%s" % (qual_str, d1, u'по', d2, - self.calendar[cal]) + scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'между', d1, u'и', - d2, self.calendar[cal]) + d2, scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], - text, self.calendar[cal]) + text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_sk.py b/src/DateHandler/_Date_sk.py index 0e513907b..c0e7954a2 100644 --- a/src/DateHandler/_Date_sk.py +++ b/src/DateHandler/_Date_sk.py @@ -113,9 +113,9 @@ class DateDisplaySK(DateDisplay): u"Jul", u"Aug", u"Sep", u"Oct", u"Nov", u"Dec" ) calendar = ( - "", u" (juliánský)", u" (hebrejský)", - u" (republikánsky)", u" (perzský)", u" (islamský)", - u" (swedish)" + "", u"juliánský", u"hebrejský", + u"republikánsky", u"perzský", u"islamský", + u"swedish" ) _mod_str = ("", u"pred ", u"po ", u"okolo ", "", "", "") @@ -135,6 +135,7 @@ class DateDisplaySK(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -145,17 +146,20 @@ class DateDisplaySK(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'od', d1, - u'do', d2, self.calendar[cal]) + u'do', d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'medzi', - d1, u'a', d2, self.calendar[cal]) + d1, u'a', d2, scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], - text, self.calendar[cal]) + text, scal) #------------------------------------------------------------------------- # diff --git a/src/DateHandler/_Date_sr.py b/src/DateHandler/_Date_sr.py index c99447751..61daaa58f 100644 --- a/src/DateHandler/_Date_sr.py +++ b/src/DateHandler/_Date_sr.py @@ -251,9 +251,9 @@ class DateDisplaySR_latin(DateDisplay): ) calendar = ( - "", u" (julijanski)", u" (hebrejski)", - u" (francuski republikanski)", u" (persijski)", u" (islamski)", - u" (švedski)" + "", u"julijanski", u"hebrejski", + u"francuski republikanski", u"persijski", u"islamski", + u"švedski" ) _mod_str = ("", "pre ", "posle ", "oko ", "", "", "") @@ -334,6 +334,7 @@ class DateDisplaySR_latin(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -344,17 +345,20 @@ class DateDisplaySR_latin(DateDisplay): elif mod == Date.MOD_SPAN: d_1 = self.display_cal[cal](start) d_2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2, - self.calendar[cal]) + scal) elif mod == Date.MOD_RANGE: d_1 = self.display_cal[cal](start) d_2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, - self.calendar[cal]) + scal) #------------------------------------------------------------------------- diff --git a/src/DateHandler/_Date_sv.py b/src/DateHandler/_Date_sv.py index c1192e9ed..d5bbc907d 100644 --- a/src/DateHandler/_Date_sv.py +++ b/src/DateHandler/_Date_sv.py @@ -129,12 +129,12 @@ class DateDisplaySv(DateDisplay): calendar = ( "", - " (juliansk)", - " (hebreisk)", - " (fransk republikansk)", - " (persisk)", - " (islamisk)", - " (svensk)" + "juliansk", + "hebreisk", + "fransk republikansk", + "persisk", + "islamisk", + "svensk" ) _mod_str = ("", u"före ", u"efter ", u"c:a ", "", "", "") @@ -151,6 +151,7 @@ class DateDisplaySv(DateDisplay): cal = date.get_calendar() qual = date.get_quality() start = date.get_start_date() + newyear = date.get_new_year() qual_str = self._qual_str[qual] @@ -161,16 +162,19 @@ class DateDisplaySv(DateDisplay): elif mod == Date.MOD_SPAN: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) - return u"%sfrån %s till %s%s" % (qual_str, d1, d2, self.calendar[cal]) + scal = self.format_extras(cal, newyear) + return u"%sfrån %s till %s%s" % (qual_str, d1, d2, scal) elif mod == Date.MOD_RANGE: d1 = self.display_cal[cal](start) d2 = self.display_cal[cal](date.get_stop_date()) + scal = self.format_extras(cal, newyear) return u"%smellan %s och %s%s" % (qual_str, d1, d2, - self.calendar[cal]) + scal) else: text = self.display_cal[date.get_calendar()](start) + scal = self.format_extras(cal, newyear) return u"%s%s%s%s" % (qual_str, self._mod_str[mod], - text, self.calendar[cal]) + text, scal) #------------------------------------------------------------------------- #