Leaflet.draw
Leaflet.draw copied to clipboard
Localization for Leaflet.draw
For anyone interested in multiple language support, I started a localization plugin to work with Leaflet.draw
by simply expanding on the L.drawLocal
(which was the prefered method describe in your README).
https://github.com/DenisCarriere/Leaflet.draw.locales
Pretty straightforward and easy to use:
var L = require('leaflet')
var drawLocales = require('leaflet-draw-locales')
// Automatically defines Leaflet.draw to the specified language
drawLocales('fr')
// Customize locale language
var locale = drawLocales('fr')
locale.draw.toolbar.buttons.polygon = 'Awesome polygon!'
L.drawLocal = locale
Currently there's only 2 languages supported (English & French), if anyone would like to contribute to adding more languages (I would very much appreciate it 🤗 !) or if we can figure out a way to port over locales
to be directly built-in Leaflet.draw.
Cannot assign to 'drawLocal' because it is a read-only property ??
I have the same problem @diamondskrt ! Could you solve it?
@Masa-99 maybe that's the problem, update your version