-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: update country names #76
fix: update country names #76
Conversation
@jessicaschilling the error looked familiar, so I fixed it, but side effects turned out to be yet another 🕳️ 🐇 Changes:
I've started ps. CI fails because commit titles in this repo need to follow ps2. I worry those manual changes are not future proof, and will be pain to re-apply on updates. Perhaps we could have a normalization function -acc[row.alpha2] = row.name
+acc[row.alpha2] = normalizedName(row.name) would do the trick here: ipfs-geoip/src/generate/index.js Line 39 in d8cd0f8
This way we would not have to touch the source data. |
> bin/generate
Finished with root hash QmVp6myP4AzFAPuP7rWS7oa4kPu76BP9dd7ahvtyEyfEnM @jessicaschilling try fetching my fixes and running |
Unfortunately |
Tested but does not pass. |
Thanks for stepping into this @lidel! |
Quick update:
|
Thanks so much for the detour for this. LMK if there's any way I can be more useful. |
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
The error looked familiar, so I fixed it locally: - needed update of ipfsd-ctl and refactor of lookup tests - refactor JS APIs to Async Iterators where needed. I thought generation is broken, but it simply took a long time, so I've improved progress reporting. License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
Note we still use the old index for lookups, so this is backward-compatible switch. License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
This change keeps source CSV intact. Instead, rules from src/generate/overrides.js are applied during the build. This way overrides can be re-applied to any future updates to geoip data. A bug where postal codes were returned as Number instead of String is also fixed. License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this should be good and ready for final checks.
Smoke-tested browser bundle locally with https://ipfs.github.io/public-gateway-checker/ and worked fine, showing USA
instead of United States
when hovering on flag 👌
My changes:
- switched back to the original CSV data, overrides are now future proof, applied during the
generate
task- rules are defined in
src/generate/overrides.js
– @jessicaschilling in spare moment take a look if I copied them correctly
- rules are defined in
- fixed papercut API changes, including external libraries for parsing csv and latin1 conversion
- fixed a bug where postal and other codes were casted as numbers in countries where those are digits-only
- not sure if anyone used postal codes (our gui apps did not), ut it is a breaking change so needs to be released as a major version
- fixed CI by rewriting history of this PR to fix the commit title and dropping Node 10 support
@lidel Thanks so much for all this unexpected work! The overrides look perfect, with one question: Some original items included double quotes to escape out commas in country names. In the overrides, some remove the comma and thus the need for double quotes (e.g. I don't have the permissions to cut a new release or update to npm, but if you do, I can take care of the remaining steps in ipfs/ipfs-webui#1603. Let me know if there's anything else I can do. 🙏 |
The double quotes story is pretty fun, and probably there is a commentary on the state of our civilization somewhere in there: The original double quotes were part of You may notice that some names in Anyway, I'll merge this and release later today, when done will comment on the ipfs-webui issue. |
Summary
This PR updates country names for typographical consistency, simplicity (favoring shorter common names over full official ones), and political sensitivity. Full list of updates is below.
This PR addresses the need in ipfs/ipfs-webui#1603 , but that issue will need updating to the resulting ipfs-geoip release in order to close.
Done
data
folder can be viewed on the gateway at https://gateway.ipfs.io/ipfs/QmVx8CwTy9bxSd1wbU9r4XpzKgHRQwKdRhDnebPV1kjErV/src/generate/index.js#L20
to new hashQmVx8CwTy9bxSd1wbU9r4XpzKgHRQwKdRhDnebPV1kjErV
To do
npm run generate
to get new generated DAG representation (I'm getting a 405 error when I try to do this)src/lookup.js#L9
for the new generated hashREADME.md#L118
with the new generated hashREADME.md#L28
accordinglyUpdates made
Antigua And Barbuda -> Antigua and Barbuda
Bosnia & Herzegovina -> Bosnia and Herzegovina
"Bolivia, Plurinational State Of" -> Bolivia
"Bonaire, Saint Eustatius And Saba" -> "Bonaire, Saint Eustatius and Saba"
Democratic Republic Of Congo -> Democratic Republic of Congo
Republic Of Congo -> Republic of Congo
Czech Republic -> Czechia
"Ceuta, Mulilla" -> Ceuta and Mulilla
"Micronesia, Federated States Of" -> Micronesia
"France, Metropolitan" -> Metropolitan France
South Georgia And The South Sandwich Islands -> South Georgia and the South Sandwich Islands
Guinea-bissau -> Guinea-Bissau
Heard Island And McDonald Islands -> Heard Island and McDonald Islands
Isle Of Man -> Isle of Man
"Iran, Islamic Republic Of" -> Iran
Saint Kitts And Nevis -> Saint Kitts and Nevis
"Korea, Democratic People's Republic Of" -> DPR Korea
"Korea, Republic Of" -> Republic of Korea
Lao People's Democratic Republic -> Laos
"Macedonia, The Former Yugoslav Republic Of" -> North Macedonia
Saint Pierre And Miquelon -> Saint Pierre and Miquelon
"Palestinian Territory, Occupied" -> Palestine
"Saint Helena, Ascension And Tristan Da Cunha" -> "Saint Helena, Ascension and Tristan da Cunha"
Svalbard And Jan Mayen -> Svalbard and Jan Mayen
Syrian Arab Republic -> Syria
Turks And Caicos Islands -> Turks and Caicos Islands
Tristan de Cunha -> Tristan da Cunha
Trinidad And Tobago -> Trinidad and Tobago
"Taiwan, Province Of China" -> Taiwan
"Tanzania, United Republic Of" -> Tanzania
United States -> USA
Vatican City State -> Vatican City
Saint Vincent And The Grenadines -> Saint Vincent and the Grenadines
"Venezuela, Bolivarian Republic Of" -> Venezuela
Virgin Islands (British) -> British Virgin Islands
Virgin Islands (US) -> US Virgin Islands
Viet Nam -> Vietnam
Wallis And Futuna -> Wallis and Futuna