1.2.3 • Published 10 months ago

leaflet-draw-locales v1.2.3

Weekly downloads
1,057
License
MIT
Repository
github
Last release
10 months ago

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

CodeLanguage
deGerman
enEnglish
arArabic
fiFinnish
frFrench
huHungarian
itItalian
kaGeorgian
esSpanish
plPolish
ptPortuguese
ruRussian
ukUkrainian
csCzech
skSlovak
nlDutch
noNorwegian
amAmharic
zhChinese
trTurkish
roRomanian

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
1.2.3

10 months ago

1.2.2

1 year ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.5.1

5 years ago

0.5.0

6 years ago

0.4.0

7 years ago