Create a canonical country code to country name mapping #2584
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's the backend support for building a list of the country names used in the app, which we can add to the data dictionary.
Why in the backend?
So that the result can combine the lists of names used in both libraries we use: https://github.com/michaelwittig/node-i18n-iso-countries in TypeScript, and https://github.com/deactivated/python-iso3166 in Python; so that it uses the version of those libraries that is actually live; and so that it lists the countries/codes that are actually found in the live data.
What next?
Next is writing a script that uses this to add to the data dictionary (not necessarily that file; maybe a supplement). But the queries I've used here are slow-ass so it's possible that the backend will time out: if that happens then I'll also need to consider indexes. I don't think it needs to be super responsive because I don't imagine third-party users needing this API, but it should work so if it actually times out I'll deal with it.