react-leaflet-draw icon indicating copy to clipboard operation
react-leaflet-draw copied to clipboard

How to change toolbar button title?

Open dentroboy opened this issue 6 years ago • 4 comments

Hey,

is there any way to change the titles of the buttons in the draw and edit toolbar? For example I want to change 'Draw a polyline'.

Thanks!

dentroboy avatar Jul 31 '19 12:07 dentroboy

There doesn't seem to be a way to do this even with leaflet-draw, or leaflet itself. Changes need to be done over there for this to be possible.

eliedrian avatar Oct 23 '19 01:10 eliedrian

This is not actually true: https://github.com/Leaflet/Leaflet.draw/blob/master/src/Leaflet.draw.js#L63

t1gor avatar Sep 08 '20 10:09 t1gor

yeah you can, this is a simple way i did

L.drawLocal.draw.toolbar.buttons.polyline="Polyline name" L.drawLocal.draw.toolbar.buttons.marker="Marker New Name"

L.drawLocal.draw.toolbar.actions.title="Cancelar dibujo" L.drawLocal.draw.toolbar.actions.text="Cancelar "

L.drawLocal.draw.toolbar.finish.title="Terminar de dibujar" L.drawLocal.draw.toolbar.finish.text="Terminar"

L.drawLocal.draw.toolbar.undo.title="Eliminar el último punto dibujado" L.drawLocal.draw.toolbar.undo.text="Eliminar el último punto"

//tooltip L.drawLocal.draw.handlers.polyline.tooltip.start="Haga clic para comenzar a dibujar la línea." L.drawLocal.draw.handlers.polyline.tooltip.cont="Haga clic para continuar dibujando la línea." L.drawLocal.draw.handlers.polyline.tooltip.end="Haga clic en el último punto para terminar la línea."

L.drawLocal.draw.handlers.marker.tooltip.start="haga clic para Colocar el Marcador."

rodri595 avatar Sep 11 '20 20:09 rodri595

It would be great to have a locale prop with standard texts in multiple languages

Ortimis avatar Feb 28 '23 10:02 Ortimis