Skip to content

Commit f33793d

Browse files
committed
Translate service profile names
Allow translation of service labels to other languages
1 parent d6f1b22 commit f33793d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ var controlOptions = {
149149
collapsible: options.lrm.collapsible,
150150
itineraryBuilder: new ItineraryBuilder(),
151151
};
152+
// translate profile names
153+
for (var profile = 0, len = controlOptions.services.length; profile < len; profile++)
154+
{
155+
controlOptions.services[profile].label = localization.t(language, controlOptions.services[profile].label) || controlOptions.services[profile].label;
156+
}
152157

153158
var router = (new L.Routing.OSRMv1(controlOptions));
154159
router._convertRouteOriginal = router._convertRoute;

0 commit comments

Comments
 (0)