alexrabarts / iso_country_codes

A Ruby library that provides ISO 3166-1 country codes/names and ISO 4217 currencies
http://github.com/alexrabarts/iso-country-codes
163 stars 62 forks source link

Add override fields capability. Simply call TWN "Taiwan". #44

Closed toothbrush closed 7 years ago

toothbrush commented 7 years ago

Using this Gem on our e-commerce site, we've received complaints from users in Taiwan that calling it "Taiwan, Province of China" is politically insensitive / inflammatory. In our codebase we're special-casing it right now, but perhaps other users of this Gem might not be aware of this issue either. Therefore see attached a patch to simply refer to it as "Taiwan".

toothbrush commented 7 years ago

FYI further reading: https://en.wikipedia.org/wiki/Political_status_of_Taiwan#Controversies

greysteil commented 7 years ago

Interesting, and thanks for the PR. I'd like to keep this file autogenerated, so can't merge this, but we've seen a few cases now where overriding makes sense for specific circumstances (see https://github.com/alexrabarts/iso_country_codes/pull/22 for another one).

I'd be 👍 on a section on the readme explaining how to monkey-patch the gem for updates like this one, and perhaps a couple of common patches.

toothbrush commented 7 years ago

Hm, i see. I don't really like the idea of getting all users of the gem to monkey patch certain countries, especially in cases like this where it may be politically sensitive and people might not think of the implications.

How about changing how this file is auto-generated, e.g., adding an "exceptions" file that is maintained alongside in the repo, and contains stuff like this PR's patch?

Where/how is the file generated from (silly question maybe)? Answering my own question: a Rake task pulls from Wikipedia's country list at https://en.wikipedia.org/wiki/ISO_3166-1.

toothbrush commented 7 years ago

Okay, what about this? I've added an overrides.yml file where people can trivially define new mappings for fields, per-country. Included by default is the Taiwan entry, because it's a politically-sensitive item.

greysteil commented 7 years ago

👍 from me. @alexrabarts - you in agreement?

alexrabarts commented 7 years ago

LGTM 👍

greysteil commented 7 years ago

Released as v0.7.8.