Skip to content
πŸ‡«πŸ‡· Localization for Leaflet.draw, changing between languages is now effortless.
TypeScript HTML JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__ Fix test Aug 2, 2019
examples change example to nl Aug 3, 2019
src update language locales code Aug 3, 2019
.editorconfig Implement Rollup and minor fixes Aug 2, 2019
.gitignore Fix test Aug 2, 2019
.travis.yml Complete build repo Jul 21, 2017
LICENSE Initial commit Jul 21, 2017
README.md
index.html Convert Library to Typescript & ES6 modules Jul 26, 2019
jest.config.js Convert Library to Typescript & ES6 modules Jul 26, 2019
package-lock.json Implement Rollup and minor fixes Aug 2, 2019
package.json
rollup.config.ts Implement Rollup and minor fixes Aug 2, 2019
tsconfig.json Implement Rollup and minor fixes Aug 2, 2019
tslint.json Convert Library to Typescript & ES6 modules Jul 26, 2019

README.md

Leaflet.draw.locales

Build Status npm version MIT licensed

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

Install

$ npm install --save leaflet-draw-locales

Example

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

Languages

Code Language
en English
fr French
es Spanish
pt Portuguese
ru Russian
uk Ukrainian
cs Czech
sk Slovak
nl Dutch

Submit a language

  • Fork this repo
  • Install node modules with npm install
  • Copy-paste an existing .ts language from src/locales/ as your template
  • Include your new language in src/index.ts, it should be included at:
    • The import at the top, import your new file
    • The language contant should get the 2 letter identification for the language
    • The switch-case should be updated to support cases for your language, setting the locale to the 2 letter code for the language
    • The Language type should be edited to include a union of all possible cases for the language you added
  • Include your language in the table in README.md
  • Run npm run test && npm run build to confirm your code works properly
  • Submit your locales via a GitHub PR
You can’t perform that action at this time.