OnroerendErfgoed / language-tags

Dealing with IANA language tags in Python
https://pypi.python.org/pypi/language-tags
MIT License
14 stars 4 forks source link

List all available tags #70

Closed arudzinska closed 1 year ago

arudzinska commented 3 years ago

I haven't found an option to list all currently available tags - correct me if it exists. Otherwise, this would be a nice feature request, as retrieving such list would be useful for creation of for e.g. choices list.

Example:

>>> from language_tags import tags
>>> tags.all()
["af-ZA", "ar-AE", "ar-SA", ...]
koenedaele commented 3 years ago

I'm not sure this is feasible. Haven't looked at IANA for a long time, but I believe IANA only lists the subtags and how they can technically be combined. So, we can validate nl-BE is valid, but technically so is nl-US, although to my knowledge there's no sizeable community of Dutch speakers in the US, so I have no idea what would be nl-US.

So, you would get a huge list of languages of which only a small subset are actually relevant.

In Atramhasis (https://github.com/OnroerendErfgoed/atramhasis) we allow the vocabulary maintainer to specify a list of valid languages (that are validated against IANA) and when someone imports a label with an unexisting language, we validate it as well.

koenedaele commented 1 year ago

Closing this as a won't fix.