Closed t-wark closed 3 years ago
I see your point. Mapping is annoying and from your perspective avoidable.
I took state codes from the ISO_3166-2 standard. IMHO in almost all use cases mapping is necessary. E.g. think about user interfaces - there will be a lot of different possibilities to phrase the state code BY
: Bayern, bayern, bavaria, DE-BY, de-0, Weißwurst-Oase, ...
So I don't think it's expedient to include a mapping to a particular service. But you're right, Google is most likely an often used service regarding this plugin. To help others, it would be a great idea to provide a mapping to the Google Placed API. Maybe you could add them to the readme or provide them in the issue comments?
Thank you for your fast reply. I understand your decision to use an ISO standard, rather than using service specific values. I just thought Google uses a good standard, that can be used everywhere. I will have a look for the values, that the places API returns and will add them here :)
Edit: Here is a table for the mapping Full name | ISO 3166-2:DE | Google Places API short_name |
---|---|---|
Baden-Württemberg | BW | BW |
Bayern | BY | BY |
Berlin | BE | Berlin |
Brandenburg | BB | BB |
Bremen | HB | HB |
Hamburg | HH | HH |
Hessen | HE | HE |
Mecklenburg-Vorpommern | MV | MV |
Niedersachsen | NI | NDS |
Nordrhein-Westfalen | NW | NRW |
Rheinland-Pfalz | RP | RP |
Saarland | SL | SL |
Sachsen | SN | SN |
Sachsen-Anhalt | ST | SA |
Schleswig-Holstein | SH | SH |
Thüringen | TH | TH |
If you use the Google Places API, for the query of the federal states to determine the holidays, then you have to remap the value for Lower Saxony (NDS) to the plugin compatible value (NI).
So it would be a good idea to use the values that Google uses for administrative_area_level_1 as short_name also as check for the federal states