perliedman / leaflet-routing-machine

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

Ideas for better language handling #640

Closed curtisy1 closed 2 years ago

curtisy1 commented 2 years ago

There are lots of issues and questions about how to customize/adjust the languages. Generally I believe it's a good idea to separate the localization logic from the core library going forward, so everyone can add their own translations or import one of the existing defaults.

A few benefits of this are:

To achieve this, we could pass the localization object itself to the routing control and let the user handle any previous setup. If not language is provided, we fall back to English. For this, a standalone package will be needed.

Since this would imply a breaking change, it could only land in a v4 together with the Typescript rewrite and the itinerary decoupling

curtisy1 commented 2 years ago

I decided against splitting the project into multiple parts for now since maintaining a monorepo of sorts would not be feasible at this stage. I'd much rather focus on getting a v4.0 ready for now and maybe roll that out simultaneously.