bbenno / languages

ISO 639-3 languages for Ruby
https://rubygems.org/gems/human_languages
MIT License
5 stars 2 forks source link

Feature request: ISO 639-2/639-5 collective codes #49

Open sandbergja opened 1 year ago

sandbergja commented 1 year ago

It would be helpful for my use case to be able to access the collective codes included in ISO 639-2 and ISO 639-5, without needing to use separate gems for ISO 639-2/5 and ISO 639-3.

For example, the following returns nil:

require 'languages'
Languages[:nah]
=> nil

Ideally, I would be able to do the following:

Languages[:nah].name
=> "Nahuatl languages"
Languages[:nah].alpha2
=> nil
Languages[:nah].alpha3_bibliographic
=> "nah"
Languages[:nah].type
=> :collective

I understand that these collective codes are not included in ISO 639-3, but it would be helpful to have them all in a single gem.

The collective codes can be found in a file here: http://id.loc.gov/vocabulary/iso639-5.tsv

@bbenno if this fits with the direction of the project, I'd be happy to create a PR for this feature.

bbenno commented 1 year ago

I think that is a great idea. I'd appreciate if you open a PR for it. Likewise, I am glad if I can support you in any case.