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

The code CS is not assigned any more #57

Open mihxil opened 5 years ago

mihxil commented 5 years ago

The country Serbia and Montenegro does not exist any more since 2006.

See https://en.wikipedia.org/wiki/Serbia_and_Montenegro

The code CS should therefore be removed, since the enum does not include formerly assigned codes.

obfischer commented 5 years ago

We should not remove the code as is breaks the backwardscompatibility. Wouldn't it be possible to flag such codes historical? I am sure that there are may systems and especially databases which still have or use such codes internally. Keeping and flagging them would be very helpful.

derekmahar commented 5 years ago

Wouldn't any application that refers to the old and now invalid code be incorrect?

obfischer commented 5 years ago

Depends on your viewpoint. If you have for example historic address data, the code CS will be still valid as it refers to a point in time where this code were valid.

Usually neither systems are updated timely - if at all, nor databases actualized.

derekmahar commented 5 years ago

Does CountryCode support old country codes? Does it provide a way to deprecate a country code that no longer exists?

mihxil commented 5 years ago

It doesn't, I requested to include formally assigned codes earlier, Wich was declined. The code CS is not even unambiguous now since it also referred to Czechoslovakia earlier. The codes to refer to these former codes are CSXX and CSHH. I think databases should migrate to either of those codes.

I tried to address these issues via .i18n-formerly-assigned, then I noticed that CS is still here, an realized the problem.

pjfanning commented 5 years ago

The country codes all have assignment values. If you only want the most up to date country codes, you can filter out country codes that are not OFFICIALLY_ASSIGNED.

alanorth commented 4 years ago

ISO 3166-3 tracks historical country names. It would be useful to include that list in this library. It is included in the widely used Debian iso-codes package.

obfischer commented 4 years ago

I agree with @alanorth. Having this information available could be very helpful if you have to maintain the same information over a long time.

mihxil commented 4 years ago

I ended up actually creating https://github.com/mihxil/i18n-formerly-assigned for that. This provides an enum for the ISO 3166-3 codes for former countries.

To use these kind of things in conjunction with nv-18n, I also made https://github.com/mihxil/i18n-regions, which provides an interface with implementations wrapping the enum values of nv-18n, but also these formerly assigned countries (and possibly more 'region' related codes).

We use it in a movie database, were the origin country of a movie can also be a former country.

derekmahar commented 4 years ago

Does https://github.com/mihxil/i18n-formerly-assigned download the ISO 3166-3 codes and generate a Java class file? Why not a Java source file?

mihxil commented 4 years ago

No, It creates a java source file.