wmnnd
International Address Formats + Forms in Elixir
Hey folks,
I’m currently working on adding an address form to Keila. Unfortunately, address forms can be wildly different from country to country. Do they require a postal code? Does the postal code go before or after the locality/city name? On top of that, certain labels for common address fields need to be different between countries (e.g. the relevant administrative region in address is called a state in Mexico but a province in Canada. Postal codes are called Postcode in the UK but ZIP Code in the US.)
Is there an actively maintained Elixir library that offers data on international address formats and these localizations? Here are the libraries I have found so far:
countries: Not updated since 2019, doesn’t seem to have any data on address formatscountriex: Not updated since 2017, has no documentationex_countries: Actively maintained, doesn’t have data on address formats.ex_cldr+ex_cldr_territories(friendly ping @kip & @schultzer): Actively maintained, provides all the necessary data to offer dropdowns for the country, including translations of country subdivisions. None of the cldr libraries seem to have any data on address formatting, however. There also doesn’t seem to be data on what the country subdivisions are called (province, state, etc).
Outside the BEAM universe, there is the PHP addressing library which includes most of the data I’m looking for, including address formats (there’s also a Ruby port). The one thing that’s also missing here is country-specific i18n for the various address fields.
What do you all usually do when you need to build an international address form? Did I miss any Elixir resources?
Most Liked
Schultzer
We definitely could use a library built on top, but you would have to make some decisions on which standard to use. From a cursory search it seams like Oasis is not the only one out there.
The times when I have had to capture this kind of information has always been for identification purposes and not shipping which is an entirely more complex problem. For identification you can usually get away with a minimal setup: country, subdivision, postal code, city, address_2, address_1, name.
Looking forward to see where this is going! And let me know if you have any questions around the CLDR dataset.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








