Add Substitle and differentiate by language

This commit is contained in:
Stefan Bethke 2025-11-18 19:33:57 +01:00
commit d734e94a7a

View file

@ -64,29 +64,39 @@ def create_schedule(sheet_file: str, schedule_file: str):
event_duration = row['Dauer'] event_duration = row['Dauer']
print(f"name={name} day={row['Tag']} start={row['Am HT-Desk']} 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)) 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({ schedule.add_event(Event({
'id': index, 'id': index,
'guid': guid, 'guid': guid,
# ('logo', None, # ('logo', None,
'date': event_start.isoformat(), 'date': event_start.isoformat(),
'start': event_start.strftime('%H:%M'), 'start': start_time_hm,
'duration': event_duration.strftime("%M:%S"), 'duration': event_duration.strftime("%H:%M"),
'room': descriptions[name]['Title'], 'room': name,
'slug': voc.tools.normalise_string(f"{name}-{row['Tag']:0.0f}-{row['Am HT-Desk']}".lower()), 'slug': voc.tools.normalise_string(f"{name}-{int(row['Tag'])}-{start_time_hm}".lower()),
'url': descriptions[name]['Link'], 'url': descriptions[name]['Link'],
'title': descriptions[name]['Title'], 'title': title,
'subtitle': None, 'subtitle': subtitle,
'track': None, 'track': "Hackertours",
'type': None, 'type': "Tour",
'language': row['Sprache'], 'language': row['Sprache'],
'abstract': descriptions[name]['Abstract'], 'abstract': abstract,
'description': None, 'description': None,
'persons': [], 'persons': [],
'links': [ 'links': [
{ {
'url': descriptions[name]['Link'], 'url': descriptions[name]['Link'],
'title': descriptions[name]['Title'] 'title': title
} }
] ]
})) }))