Motivation:
In regions that have multiple official languages, transit
agencies/operators typically have language-specific names and web
pages. In order to best serve riders in those regions, GTFS should be
able to represent these language-dependent values.
Proposal:
translations.txt - Optional - This file represents translations for
values used elsewhere in the feed.
translations.txt would define the following fields:
original_value (required): This is used to match values in any URL or
human-readable text field in the feed. (The fields that qualify for
translation end in "_name", "_desc", "_headsign", and "_url".)
translation (required): Whenever the contents of the feed are
displayed in the language specified in the "lang" field, values
matching original_value are replaced with the value specified here.
lang (required): A two-letter ISO 639-1 code for the language of the
translated value. Please refer to
http://www.loc.gov/standards/iso639-2/php/code_list.php for a list of
valid values.
Here's a brief example:
original_value, translation,
lang
Hospital, Hôpital, fr
stopname-3618321864, Eiffel Tower, en
stopname-3618321864, Tour Eiffel, fr
http://www.example.com/3618321864, http://www.example.com/3618321864?lang=2, fr
The first row demonstrates how the file can be used to translate a
human readable name in the default language of the feed (defined in
agency_lang in agency.txt) into a name in an alternate language. Note
that this only translates entire values; it would match a stop named
"Hospital" but not one named "Central Hospital".
The second and third rows show how abstract values can be used in the
feed for greater precision. In this case, there would presumably be a
stop_name value of "stopname-3618321864" in the feed's stops.txt file.
When viewed in an English interface, that stop would be shown as
"Eiffel Tower", and when viewed in French, it would be shown as "Tour
Eiffel".
The final row shows how the translated version of a URL can be
provided. Multilingual agencies tend to offer their landing pages in
multiple languages, so we want to be able to give the rider the
appropriate page when they click through for more information about a
stop or route.
Testing:
A version of this mechanism is currently used to provide multilingual
information for the clickable transit stops on Google Maps in several
countries. As usual, more test data is welcome.
Joe Hughes
Google Transit