top | item 41327393

(no title)

bojanz | 1 year ago

There is a middle ground and some common patterns that can help.

The address field names are fairly standardized[0] and Google has an open dataset (used by Chrome and Android) describing which countries need which fields[1].

I have an older PHP library[2] and a newer Go library[3] that build upon this, while crowdsourcing fixes (since Google hasn't updated their dataset in a while). The Go library allows me to serve all address formats and state lists in a single HTTP request, which can then power a very fast JS widget.

[0] Initially by the OASIS eXtensible Address Language (xAL) which trickled down into everything from maps to HTML5 autocomplete.

[1] https://chromium-i18n.appspot.com/ssl-address

[2] https://github.com/commerceguys/addressing

[3] https://github.com/bojanz/address

discuss

order

No comments yet.