alexander-albers / tripkit

Swift library for querying data from public transport providers.
MIT License
81 stars 8 forks source link

Support different languages #70

Closed alexander-albers closed 2 years ago

alexander-albers commented 2 years ago

Many transit providers have translations for stop names or info texts, at least for English language. TripKit should ideally have an option to supply a language code to the requests (or a variable of the provider), similar to how hafas-client does it.

This parameter could default to the current locale and check in a mapping of supported language codes whether this language can be used or whether English/the provider default language should be used.

For Hafas Legacy, this page gives a good overview of supported codes and their meaning. For Efa, the language request url parameter can take any ISO 638:1988 value.

derhuerst commented 2 years ago

For Hafas, this page gives a good overview of supported codes and their meaning.

This page is about the web-based HAFAS APIs, not about the mgate.exe flavour. The latter works differently, and also it used to work inconsistently from endpoint to endpoint (e.g. de vs deu). public-transport/transport-apis aims to provide an up-to-date list of supported languages, so if you see something outdated, please report it.