Localization for Leaflet.draw, changing between languages is now effortless.
$ npm install --save leaflet-draw-locales
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
Code | Language |
---|---|
en | English |
fr | French |
es | Spanish |
pt | Portuguese |
ru | Russian |
uk | Ukrainian |
cs | Czech |
- Fork this repo
- Copy-paste an existing
.js
language fromlocales/
as your template - Include your new language in
index.js
,test.js
&index.d.ts
- Submit your locales via a GitHub PR