Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanish address format #219

Open
lex-squareup opened this issue Jul 6, 2021 · 0 comments
Open

Spanish address format #219

lex-squareup opened this issue Jul 6, 2021 · 0 comments

Comments

@lex-squareup
Copy link

lex-squareup commented Jul 6, 2021

The address format for Spain is currently as follows:

"fmt":"%N%n%O%n%A%n%Z %C %S"

It looks wrong to me to have the province (%S) separated by a space. Instead, one of the following changes would make most sense:

  1. Put it in parentheses. That appears to be the more idiomatic formatting, but it seems to make it harder to make the province be optional.
  2. Add an optional field fmt_admin1 which, when present, indicates a format to use for the admin1 field if present. Then set fmt_admin1 to "(%S)" for Spain.
  3. Make it a newline (%n) instead of a space. This is a simple fix that libaddressinput supports and that is also supported by the postal service.

Regarding the first point, out in the wild, a well-formatted Spanish address seems to leave out the province if it's obvious. For example, for the city of Barcelona, one would write Barcelona by itself rather than write "Barcelona (Barcelona)". For that reason, it may be problematic to make the format string as simple as "%N%n%O%n%A%n%Z %C (%S)". When the admin1 is not present, the address would end up with empty parentheses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant