google / google/libaddressinput

Spanish address format

Open
#219 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
624
Forks
109
PR merge metrics
No merged PRs in 30d

Description

The [address format for Spain](https://www.gstatic.com/chrome/autofill/libaddressinput/chromium-i18n/ssl-address/data/ES) 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.
1. 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.
1. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.