Skip to content
New issue

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

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

Already on GitHub? # to your account

use ISO 3166-1 Alpha-2 codes to identify nations #231

Closed
JohnRDOrazio opened this issue Sep 22, 2024 · 1 comment
Closed

use ISO 3166-1 Alpha-2 codes to identify nations #231

JohnRDOrazio opened this issue Sep 22, 2024 · 1 comment
Milestone

Comments

@JohnRDOrazio
Copy link
Member

Currently, we identify nations in the folder structure and in the API /data/nation/{key} path by the uppercase English display name of the region. I have verified that both javascript and PHP use the same display names for nations, so it's not too much of a problem.

However, it's not so simple to derive the ISO code from the display name of the nation, especially once we've transformed it to uppercase. It's almost impossible to go from uppercase to the original display form. So there is a little bit of overhead in keeping for example a country_iso property in the /calendars metadata endpoint's national_calendars data, or in creating frontend map structures to derive the ISO code from the nation name. If we just used the ISO code to store data about nations, we wouldn't need frontend map structures, since it's easy enough to derive the display name from the ISO code. This will also provide for better folder structures, avoiding strange folder names with spaces and ampersands and whatnot.

@JohnRDOrazio JohnRDOrazio added this to the v4.0 milestone Sep 22, 2024
@JohnRDOrazio
Copy link
Member Author

Fixed in commits:

Perhaps also some fixes were mixed into a few other commits here and there, if something was missed in these three commits...

All seems to be working fine so closing as completed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant