Localization for Leaflet.draw, changing between languages is now effortless.
npm install leaflet-draw-locales


> Localization for Leaflet.draw, changing between languages is now effortless.

``bash`
$ npm install --save leaflet-draw-locales
`js
import drawLocales from 'leaflet-draw-locales'
// Automatically defines Leaflet.draw to the specified language
drawLocales('fr')
// Customize locale language
const locale = drawLocales('fr')
locale.draw.toolbar.buttons.polygon = 'Awesome polygon!'
L.drawLocal = locale
`
| Code | Language |
|------|-------------|
| de | German |
| en | English |
| ar | Arabic |
| fi | Finnish |
| fr | French |
| hu | Hungarian |
| it | Italian |
| ka | Georgian |
| es | Spanish |
| pl | Polish |
| pt | Portuguese |
| ru | Russian |
| uk | Ukrainian |
| cs | Czech |
| sk | Slovak |
| nl | Dutch |
| no | Norwegian |
| am | Amharic |
| zh | Chinese |
| tr | Turkish |
| ro | Romanian |
- Fork this repo
- Install node modules with npm install.ts
- Copy-paste an existing language from src/locales/ as your templatesrc/index.ts
- Include your new language in , it should be included at:language
- The import at the top, import your new file
- The contant should get the 2 letter identification for the languagelocale
- The switch-case should be updated to support cases for your language, setting the to the 2 letter code for the languageLanguage
- The type should be edited to include a union of all possible cases for the language you addedREADME.md
- Include your language in the table in npm run test && npm run build` to confirm your code works properly
- Run
- Submit your locales via a GitHub PR