perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.06k stars 347 forks source link

own translation #633

Open dobrys opened 3 years ago

dobrys commented 3 years ago

Hi there, How can i can create my own translation (on Bulgarian) ? I try to modify Russian translation into 'localization.js',its compile but on runtime got error "Routing error: Object { status: -3, message: "Error: language code bg not loaded" }"

curtisy1 commented 2 years ago

Hey @dobrys I realize this reply might be a bit late but maybe it's helpful anyway

language code bg not loaded

This sounds like you're initializing the router with the language option set to "bg". As there is no bg in the localization.js or in osrm-text-instructions, your only option currently would be to set stepToText to true in the options and modifying another translation (as you already did with the Russian one). This should work as a temporary solution at least.

I agree that the current handling of languages probably isn't ideal as it's also responsible for a huge increase in bundle size. Unfortunately, doing something about it would be a breaking change so it will have to wait until the next major version is released