mapbox / locale-utils

0 stars 2 forks source link

Map deprecated language codes to modern equivalents #4

Closed 1ec5 closed 6 years ago

1ec5 commented 6 years ago

The following ISO 639:1988 codes were deprecated 21 years ago, but Android’s Locale.getLanguage() method still returns them:

This library should map the deprecated codes to the standard ISO 639-1 equivalents, so that Android developers who interact with an API that uses this library don’t have to worry about these otherwise obscure codes.

/cc @bsudekum @danesfeder @devotaaabel @danpaz @Guardiola31337

1ec5 commented 6 years ago

Several ISO 639 identifiers, such as mo/mol, have been deprecated as well, but I’m unaware of any operating systems that prefer them over the standard identifiers. #1 would be a more effective way of increasing ISO 639 coverage.

bsudekum commented 6 years ago

👍 , I think it'd be fair to handle deprecated locales here.

bsudekum commented 6 years ago

@1ec5 on second thought, this library does not have any concern to the locales passed into it. I think this ticket needs to be moved elsewhere.

1ec5 commented 6 years ago

While it is the case that the client has to pass in the available language codes and the code to match, this library should be responsible for knowing that he and iw are synonymous. For example, locale.bestMatchingLocale('iw', ['he'])) should return true, but it currently returns false.

bsudekum commented 6 years ago

Okay, that makes sense.