From 8600fefd2132efd85295b00975779693cf1c805d Mon Sep 17 00:00:00 2001 From: "geortz@gmail.com" Date: Mon, 30 Dec 2013 22:41:14 +0000 Subject: [PATCH] dayname stuff DE language file {Neels} git-svn-id: https://callirhoe.googlecode.com/svn/branches/next@24 81c8bb96-aa45-f2e2-0eef-c4fa4a15c6df --- callirhoe.py | 11 ++++++----- holidays/french_holidays.EN.dat | 4 ++-- lang/DE.py | 34 +++++++++++++++++++++++++++++++++ lang/EL.py | 2 +- lang/EN.py | 2 +- lang/FR.py | 2 +- layouts/classic.py | 2 +- 7 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 lang/DE.py diff --git a/callirhoe.py b/callirhoe.py index cf1fcf2..75dfeab 100755 --- a/callirhoe.py +++ b/callirhoe.py @@ -19,8 +19,8 @@ # TODO: -# fix overlapping multi-day events: -# use 'EVENT..', '..EVENT..', '..EVENT' formatting or sth. similar +# fix day names (length) +# fix odd-even year color (always start from dark) # allow to change background color (fill), other than white # page spec parse errors @@ -207,6 +207,7 @@ if options.geom_assign: calendar.month_name = Language.month_name calendar.day_name = Language.day_name +calendar.short_day_name = Language.short_day_name def itoa(s): try: @@ -262,8 +263,8 @@ hp = holiday.HolidayProvider(Style.dom, Style.dom_weekend, Style.dom_holiday, Style.dom_weekend_holiday, Style.dom_multi, Style.dom_weekend_multi) -print "Holidays: ", options.holidays -for f in options.holidays: - hp.load_holiday_file(f) +if options.holidays: + for f in options.holidays: + hp.load_holiday_file(f) Layout.draw_calendar(Outfile, Year, Month, MonthSpan, (Style,Geometry), hp, _version) diff --git a/holidays/french_holidays.EN.dat b/holidays/french_holidays.EN.dat index f6bcf50..02982f5 100644 --- a/holidays/french_holidays.EN.dat +++ b/holidays/french_holidays.EN.dat @@ -24,5 +24,5 @@ ce|1||||Easter Monday|off ce|39||||Ascension|off ce|50||||Whit Monday|off -f|23*15|2|2013|winter vacations (B)||multi -f|22*15|2|2014|winter vacations (B)||multi +f|23*16|2|2013|winter vacations (B)||multi +f|22*16|2|2014|winter vacations (B)||multi diff --git a/lang/DE.py b/lang/DE.py new file mode 100644 index 0000000..b043667 --- /dev/null +++ b/lang/DE.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +# callirhoe - high quality calendar rendering +# Copyright (C) 2012 George M. Tzoumas + +# German language data +# Copyright (C) 2013 Neels Hofmeyr + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/ + +day_name = [ u'Montag', u'Dienstag', u'Mittwoch', + u'Donnerstag', u'Freitag', u'Samstag', u'Sonntag' ] + +short_day_name = [ u'Mo', u'Di', u'Mi', u'Do', u'Fr', u'Sa', u'So' ] + +month_name = [ '', + u'Januar', u'Februar', u'März', u'April', + u'Mai', u'Juni', u'Juli', u'August', + u'September', u'Oktober', u'November', u'Dezember' ] + +short_month_name = [ '', + u'Jan', u'Feb', u'Mrz', u'Apr', u'Mai', u'Jun', + u'Jul', u'Aug', u'Sep', u'Okt', u'Nov', u'Dez' ] diff --git a/lang/EL.py b/lang/EL.py index 1a87f03..73bc92e 100644 --- a/lang/EL.py +++ b/lang/EL.py @@ -19,7 +19,7 @@ day_name = [ u'Δευτέρα', u'Τρίτη', u'Τετάρτη', u'Πέμπτη', u'Παρασκευή', u'Σάββατο', u'Κυριακή' ] -short_day_name = [ u'Δευ', u'Τρι', u'Τετ', u'Πεμ', u'Παρ', u'Σαβ', u'Κυρ' ] +short_day_name = [ u'Δε', u'Τρ', u'Τε', u'Πε', u'Πα', u'Σα', u'Κυ' ] month_name = [ '', u'Ιανουάριος', u'Φεβρουάριος', u'Μάρτιος', u'Απρίλιος', u'Μάιος', u'Ιούνιος', u'Ιούλιος', u'Αύγουστος', diff --git a/lang/EN.py b/lang/EN.py index 5dbb642..5bb58e4 100644 --- a/lang/EN.py +++ b/lang/EN.py @@ -19,7 +19,7 @@ day_name = [ u'Monday', u'Tuesday', u'Wednesday', u'Thursday', u'Friday', u'Saturday', u'Sunday' ] -short_day_name = [ u'Mon', u'Tue', u'Wed', u'Thu', u'Fri', u'Sat', u'Sun' ] +short_day_name = [ u'Mo', u'Tu', u'We', u'Th', u'Fr', u'Sa', u'Su' ] month_name = [ '', u'January', u'February', u'March', u'April', diff --git a/lang/FR.py b/lang/FR.py index 854297d..d0b00d6 100644 --- a/lang/FR.py +++ b/lang/FR.py @@ -19,7 +19,7 @@ day_name = [ u'Lundi', u'Mardi', u'Mercredi', u'Jeudi', u'Vendredi', u'Samedi', u'Dimanche' ] -short_day_name = [ u'Lun', u'Mar', u'Mer', u'Jeu', u'Ven', u'Sam', u'Dim' ] +short_day_name = [ u'Lu', u'Ma', u'Me', u'Je', u'Ve', u'Sa', u'Di' ] month_name = [ '', u'Janvier', u'Février', u'Mars', u'Avril', diff --git a/layouts/classic.py b/layouts/classic.py index 30ff102..ecd9fe2 100644 --- a/layouts/classic.py +++ b/layouts/classic.py @@ -123,7 +123,7 @@ def _draw_day_cell_long(cr, rect, day, header, footer, theme, show_day_name): align = (2,valign), font = S.font, measure = "88") # draw name of day if show_day_name: - draw_str(cr, text = calendar.day_name[day_of_week][0], rect = Rdow, stretch = -1, stroke_rgba = S.fg, + draw_str(cr, text = calendar.short_day_name[day_of_week], rect = Rdow, stretch = -1, stroke_rgba = S.fg, align = (2,valign), font = S.font, measure = "M") Rh, Rf = rect_vsplit(Rhf, *G.hf_vsplit) # draw header