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

Breaking: make country codes ISO 3166 conformant #267

Closed
XSpielinbox opened this issue Aug 16, 2023 · 3 comments · Fixed by #388
Closed

Breaking: make country codes ISO 3166 conformant #267

XSpielinbox opened this issue Aug 16, 2023 · 3 comments · Fixed by #388
Labels
status: new Initial state for every issue / pull request type: breaking This is a breaking change
Milestone

Comments

@XSpielinbox
Copy link
Contributor

XSpielinbox commented Aug 16, 2023

More information

Currently the list of countries largely uses the two letter codes as defined in ISO 3166-1 alpha-2.
The subdivisions also mostly use the codes defined in ISO 3166-2.

I hereby propose to unify this, that every subdivision adheres to this format.
So e.g. gb.je (Jersey) should be renamed to gb.jsy, md.bti should be renamed to md.ba (Bălți) and in.dd and in.dn should be merged to in.dh (Dādra and Nagar Haveli and Damān and Diu). [1]

As finer grained solutions for e.g. a certain city or township will be needed (e.g. for Assumption day), which will not be possible to do in a uniform way, wherefore I suggest to always put them behind the corresponding subdivision of ISO 3166-2. So e.g. lu.clu should be lu.lu, if it applies to the complete subdivision (Canton of Luxembourg). If it really only applies to its principal city, Luxembourg (more commonly known as Luxembourg City), it should then be something like lu.lu.clu. [2]

This would ensure consistency, prevent conflicts in the future and would make the codes easier to understand and amend/append.

[1]

[2]

@XSpielinbox XSpielinbox added the status: new Initial state for every issue / pull request label Aug 16, 2023
@XSpielinbox XSpielinbox changed the title **make country codes ISO 3166 conformant** make country codes ISO 3166 conformant Aug 16, 2023
@derTobsch
Copy link
Contributor

I really like the idea to be ISO 3166-2 conform (https://en.wikipedia.org/wiki/ISO_3166-2).

We should:

  • provide information about the country and their available subdivision via api
  • put wrongly grouped subdivisions in their own file (like jersey)
  • ...

@derTobsch derTobsch added the type: enhancement A general enhancement label Sep 20, 2023
@derTobsch derTobsch added this to the 0.22.0 milestone Sep 22, 2023
@XSpielinbox XSpielinbox changed the title make country codes ISO 3166 conformant Breaking: make country codes ISO 3166 conformant Sep 23, 2023
@XSpielinbox
Copy link
Contributor Author

XSpielinbox commented Sep 23, 2023

@derTobsch assuming that one would also only support the "correct", ISO 3166-1 conformant country codes and their ISO 3166-2 subdivisions for all other countries, as you stated for the British Crown dependencies in #270 (comment) and you said in #269 (comment) that one would not maintain holidays that apply to a city only and given that there are over 5000 ISO 3166-2 codes, I would assume that this shall mean that one would only support the countries and divisions from ISO 3166 and would drop all other specialties. However, cities that are specified as a ISO 3166 code would still be supported.

For the sake of accuracy I would nevertheless apply holidays to these countries/subdivisions in the way they are applicable in the majority of the given countries/subdivisions.

This would be a good compromise between flexibility and maintainability effort in my opinion and set a clear guideline on what is to specific that it cannot get maintained here for everyone. In case, someone needs it they can always extend Jolliday to include it in there own sub-subconfiguration, right?
In case Jolliday becomes really big and popular some day that way more people contribute to it, one could also again change this policy then and reintroduce these more specific cases.

Would this be ok for you?

@derTobsch
Copy link
Contributor

More information

Currently the list of countries largely uses the two letter codes as defined in ISO 3166-1 alpha-2. The subdivisions also mostly use the codes defined in ISO 3166-2.

I hereby propose to unify this, that every subdivision adheres to this format. So e.g. gb.je (Jersey) should be renamed to gb.jsy, md.bti should be renamed to md.ba (Bălți) and in.dd and in.dn should be merged to in.dh (Dādra and Nagar Haveli and Damān and Diu). [1]

As finer grained solutions for e.g. a certain city or township will be needed (e.g. for Assumption day), which will not be possible to do in a uniform way, wherefore I suggest to always put them behind the corresponding subdivision of ISO 3166-2. So e.g. lu.clu should be lu.lu, if it applies to the complete subdivision (Canton of Luxembourg). If it really only applies to its principal city, Luxembourg (more commonly known as Luxembourg City), it should then be something like lu.lu.clu. [2]

This would ensure consistency, prevent conflicts in the future and would make the codes easier to understand and amend/append.

[1]

* https://www.iso.org/obp/ui/#iso:code:3166:JE

* https://www.iso.org/obp/ui/#iso:code:3166:GB

* https://en.wikipedia.org/wiki/ISO_3166-2:JE

* https://en.wikipedia.org/wiki/ISO_3166-2:GB

* https://www.iso.org/obp/ui/#iso:code:3166:MD

* https://en.wikipedia.org/wiki/ISO_3166-2:MD

* https://www.iso.org/obp/ui/#iso:code:3166:IN

* https://en.wikipedia.org/wiki/ISO_3166-2:IN

[2]

* https://www.iso.org/obp/ui/#iso:code:3166:LU

* https://en.wikipedia.org/wiki/ISO_3166-2:LU

We go with exactly this approach. Thanks @XSpielinbox !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: new Initial state for every issue / pull request type: breaking This is a breaking change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants