openplans/OpenTripPlanner — Issue #588: Localize the Elevation Graph strings
Author: fpurcell
Created: 2012-01-18 23:53:10+00:00
State: open
Labels: webapp

The elevation graph is using either hard-coded mode strings or maybe constants from .locale... Instead, the strings for the elevation graph should be configurable, and pulled from the lang object defined in otp.config.locale.modes. Thus, the elevation graph will use the same mode strings that the itinerary uses (as opposed to the often mis-named GTFS strings that are the default in the translation files, ala ("TRAM" for light-rail, etc...).

In TriMet's case, we override the default English translation of 'TRAM' and 'RAIL' in a to the following:
otp.config.locale.modes = override(
{
TRAM: "Rail", // note: calling this rail, since there's no light-rail/streetcar difference in GTFS (both tram)
RAIL: "Commuter Rail",
GONDOLA: "Tram"
});