Languages
The ten languages, how one is chosen, and the fallback.
Texts are available in German de, English en, French fr, Italian it, Spanish es, Russian ru, Chinese zh, Japanese ja, Korean ko and Arabic ar. Choose with lang; any other value answers 400.
Without lang, the API reads the Accept-Language header and answers in the supported language it rates highest (quality values count; fr-CH counts as fr; de;q=0 refuses German). Without either, or when the header names none of the ten languages (or only *), you get German. lang always wins over the header. This applies to every endpoint under /events, /showtimes, /locations, /event-series, /festivals, /artists, /works, /genres, /regions and /search that takes lang; their answers carry Vary: Accept-Language, so caches keep one copy per language. Articles and newsletter delivery go by lang alone and ignore the header.
If a record has no text in the requested language, the API falls back to German, then English, then any language the record has. The fallback takes the whole text block of a record: if the French block exists but has no long description, description is null and is not filled from German.
You can always see what you received:
- Each record carries
lang, the language of its text (nullif it has no text at all). On an event it is the language of the event series' text, as on/showtimes/live; on the map layers/locations/geojson…it is in each feature'sproperties. - The answer carries
Content-Languagewith every language served on that page, for exampleContent-Language: enorContent-Language: en, dewhen some records fell back to German. It is set on/events,/showtimes,/locations,/event-series,/festivals,/artists,/works,/genresand/regions.
Genres and regions have only a name to translate; lang there says which language name is in, and the full set is in translations:
- A genre has
namein the asked language, falling back to German, English, any; withoutlangandAccept-Language, in German. A genre without any name has itsslugasnameandlang: null. /regionsand/regions/{id}givenamein the asked language (default German);lang: nullmeans the region has no translated name andnameis its official name. The other region lists keep the official name and send nolangunless you ask for a language.
languages on an event is something else: the languages the event is held in.