Translate station names¶
Some transit providers offer services in multiple languages - one of which is the National Railway Company of Belgium (locally known as NMBS/SNCB, for Nationale Maatschappij der Belgische Spoorwegen in Dutch or Société nationale des chemins de fer belges in French). The company provides station names in multiple languages and are displayed depending on the user’s language and location settings.
The NMBS/SNCB publishes GTFS data in French as shown in the file below:
Since the agency language is set to French, the station names are listed in French in stops.txt.
stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,platform_code S8815040,,Bruxelles-Ouest,,50.8485600,4.32104000,,,1,, S8821006,,Anvers-Central,,51.2172000,4.42109800,,,1,,
The file translations.txt is then used to translate the station names from the default agency language (French in this case) to Dutch.
- In this example, the station names from stops.txt are translated, and records in stops.txt are identified by a
stopsare listed under table names (in reference to stops.txt)
stop_nameis listed under
field_name(since the names of stations will be translated)
stop_idfor the station name to be translated from French is listed under
record_id(in this case, the
- The name is translated to Dutch (nl)
- Lastly, the translated name is listed under translation
There is another way to translate names in GTFS using the file translations.txt, where the field
field_value is used instead of
record_id. In this case, the station name is used to find the record to be translated from stops.txt.