From d734e94a7a46fb584fd0983fdfde9a7c5d778156 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Tue, 18 Nov 2025 19:33:57 +0100 Subject: [PATCH] Add Substitle and differentiate by language --- hackertours.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/hackertours.py b/hackertours.py index fab5181..6e63ea3 100644 --- a/hackertours.py +++ b/hackertours.py @@ -64,29 +64,39 @@ def create_schedule(sheet_file: str, schedule_file: str): event_duration = row['Dauer'] print(f"name={name} day={row['Tag']} start={row['Am HT-Desk']} duration={row['Dauer']}") guid = voc.tools.gen_uuid('{}-{}-{}'.format(row['Tag'], row['Am HT-Desk'], name)) + start_time_hm = event_start.strftime('%H:%M') + + if row['Sprache'] == "de": + title = descriptions[name]['Title DE'] + subtitle = descriptions[name]['Subtitle DE'] + abstract = descriptions[name]['Abstract DE'] + else: + title = descriptions[name]['Title EN'] + subtitle = descriptions[name]['Subtitle EN'] + abstract = descriptions[name]['Abstract EN'] schedule.add_event(Event({ 'id': index, 'guid': guid, # ('logo', None, 'date': event_start.isoformat(), - 'start': event_start.strftime('%H:%M'), - 'duration': event_duration.strftime("%M:%S"), - 'room': descriptions[name]['Title'], - 'slug': voc.tools.normalise_string(f"{name}-{row['Tag']:0.0f}-{row['Am HT-Desk']}".lower()), + 'start': start_time_hm, + 'duration': event_duration.strftime("%H:%M"), + 'room': name, + 'slug': voc.tools.normalise_string(f"{name}-{int(row['Tag'])}-{start_time_hm}".lower()), 'url': descriptions[name]['Link'], - 'title': descriptions[name]['Title'], - 'subtitle': None, - 'track': None, - 'type': None, + 'title': title, + 'subtitle': subtitle, + 'track': "Hackertours", + 'type': "Tour", 'language': row['Sprache'], - 'abstract': descriptions[name]['Abstract'], + 'abstract': abstract, 'description': None, 'persons': [], 'links': [ { 'url': descriptions[name]['Link'], - 'title': descriptions[name]['Title'] + 'title': title } ] }))