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

Clarify what happened to Spanish subdivisions #160

Open
bojanz opened this issue Apr 27, 2018 · 3 comments
Open

Clarify what happened to Spanish subdivisions #160

bojanz opened this issue Apr 27, 2018 · 3 comments

Comments

@bojanz
Copy link

bojanz commented Apr 27, 2018

In the past 4 months there has been a shift in how Spanish subdivisions are handled.

The ISO list is mixed language-wise, provinces are named in their majority language, hence Lleida instead of Llerida, etc. This was the approach taken by the dataset as well. In 2018 the ES list changed:

  1. The province list has been separated into es/ca/ga versions. This makes sense at a glance.
  2. The provinces were rekeyed, the previous keys were province names, now we're using the codes (C/VI/AB/etc). This is confusing, cause the key is supposed to be used when formatting an address, but Spain doesn't use codes that way, they always write the province names.
  3. The ISO codes have been removed (no isoid for any of them). This looks accidental. Other countries have ISO codes defined even if the subdivision is keyed by the short version of the code.

So, I'm asking for clarification, and treating #3 as a bug.

I've had to revert to the 2017 version of the list in commerceguys/addressing, cause even the translation change was confusing users, who were used to the mixed list.

@sockix
Copy link
Contributor

sockix commented Apr 5, 2019

Is this still an issue.

AFAICT the iso-ids are present, and the 'key' values are the full names not abbreviations.

@bojanz
Copy link
Author

bojanz commented May 31, 2019

I don't see any changes compared to when I opened the issue.

E.g. https://chromium-i18n.appspot.com/ssl-address/data/ES/L has no isoid.

@lex-squareup
Copy link

I am confused on the province treatment as well. For reference, here is the current data for ES, after pretty printing the JSON:

{
"id":"data/ES",
"key":"ES",
"name":"SPAIN",
"lang":"es",
"languages":"es~ca~gl~eu",
"fmt":"%N%n%O%n%A%n%Z %C %S",
"require":"ACSZ",
"upper":"CS","zip":"\\d{5}",
"zipex":"28039,28300,28070",
"posturl":"http://www.correos.es/contenido/13-MenuRec2/04-MenuRec24/1010_s-CodPostal.asp",
"sub_names":"Álava~Albacete~Alicante~Almería~Asturias~Ávila~Badajoz~Barcelona~Burgos~Cáceres~Cádiz~Cantabria~Castellón~Ceuta~Ciudad Real~Córdoba~Cuenca~Girona~Granada~Guadalajara~Guipúzcoa~Huelva~Huesca~Islas Baleares~Jaén~La Coruña~La Rioja~Las Palmas~León~Lérida~Lugo~Madrid~Málaga~Melilla~Murcia~Navarra~Ourense~Palencia~Pontevedra~Salamanca~Santa Cruz de Tenerife~Segovia~Sevilla~Soria~Tarragona~Teruel~Toledo~Valencia~Valladolid~Vizcaya~Zamora~Zaragoza",
"sub_zips":"01~02~03~04~33~05~06~08~09~10~11~39~12~51~13~14~16~17~18~19~20~21~22~07~23~15~26~35~24~25~27~28~29~52~30~31~32~34~36~37~38~40~41~42~43~44~45~46~47~48~49~50",
"sub_keys":"VI~AB~A~AL~O~AV~BA~B~BU~CC~CA~S~CS~CE~CR~CO~CU~GI~GR~GU~SS~H~HU~PM~J~C~LO~GC~LE~L~LU~M~MA~ML~MU~NA~OR~P~PO~SA~TF~SG~SE~SO~T~TE~TO~V~VA~BI~ZA~Z"}

https://www.gstatic.com/chrome/autofill/libaddressinput/chromium-i18n/ssl-address/data/ES

The public guidance I have found is that the province is optional, but is spelled out when supplied.

Sra Ana Jimenez
Mimbreras 4
03201 ELCHE (Alicante)

https://www.angloinfo.com/how-to/spain/housing/postal-system

Shouldn't the sub_keys field be missing, and/or use the spelled-out names of the provinces? The guidance I have found on formatting is as follows:

First of all, you would look at the data for data/US and see if there was a sub_keys field. * Since there is, you would check to see if “XX” is a valid value there (or, alternatively, if data/US/XX exists). * If it doesn’t, and XX is also not a valid value in the sub_names for the US, this indicates “XX” is not an accepted value for the admin_area. (If there were no sub_keys defined, then “XX” would be accepted.)

https://github.com/google/libaddressinput/wiki/AddressValidationMetadata

Here are some examples from other countries:

  • In the US data, there is a "subkey" of "GA" that goes with the "name" of "Georgia". That means you should display "Georgia" in a drop-down menu, but write "GA" when formatting the address.
  • In the IE data, there is a "subkey" of "Co. Carlow" and no associated "name" at all. That means that you should use "Co. Carlow" both in the dropdown and also when formatting the field.

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

3 participants