TakahikoKawasaki / nv-i18n

Package to support internationalization, containing ISO 3166-1 country code enum, ISO 639-1 language code enum, etc.
Apache License 2.0
389 stars 115 forks source link

Feature request: ISO 3166-2 #8

Open apemberton opened 10 years ago

apemberton commented 10 years ago

ISO 3166-2 defines the subdivisions of ISO 3166-1 (which defines countries): http://en.wikipedia.org/wiki/ISO_3166-2

Any chance to include 3166-2 support to access, for example, the 50 US states?

TakahikoKawasaki commented 10 years ago

Thank you for your request. I didn't know the existence of ISO 3166-2.

It seems worth adding ISO 3166-2 support, but it will require a bit different design pattern. In other words, it shouldn't be a simple enum, I guess. So, I need some time to consider what design is the best. Please give me time.

mattbishop commented 10 years ago

I agree this would be a really useful feature as right now we all have to maintain the states/provinces ourselves.

They could be enums, but not just one enum. I imagine each Country would have it's own Subivision enum. US -> 50 Subdivisions (actually more, given territories like Puerto Rico) is one Enum definition; CA -> 13 Subdivisions.

You always navigate down from Country, never up. The reason is that many countries share the same subdivision codes, so you can't tell which. For instance, both Mexico and Canada have a 'BC' Subdivision.

danielyli commented 8 years ago

+1 for ISO 3166-2 support

raderio commented 5 years ago

+1

msalegre commented 5 years ago

Any news about this?

qilingit commented 3 years ago

+1