for more information visit the package's GitHub page
Package contains the following modules:
Convert to and from alpha2, alpha3, numeric codes and translate into 23 languages.
import Iso3166
import Iso3166.Dutch
twoLetterCode : String
twoLetterCode =
Iso3166.toAlpha2 Iso3166.NL
--> "nl"
threeLetterCode : String
threeLetterCode =
Iso3166.toAlpha3 Iso3166.NL
--> "nld"
numericCode : String
numericCode =
Iso3166.toNumeric Iso3166.NL
--> 528
translated : String
translated =
Iso3166.Dutch.toName Iso3166.NL
--> "Nederland"
Note that using this package might increase asset size a quite a bit.
Using toAlpha2
and one toName
adds about 2kB to a uglified + gzipped js file.
It's just data and this might not be required to be bundled and could easily be fetched over http.
Clone stefangabos/world_countries into this repo, run cabal run elm-iso3166
to generate Elm files.
All modules are generated with data provided by stefangabos/world_countries a repository sourcing the codes and translations from Wikipedia.