openzim / python-scraperlib

Collection of Python code to re-use across Python-based scrapers
GNU General Public License v3.0
18 stars 16 forks source link

Add `is_valid_langcode()` utility method #84

Closed anshulxyz closed 1 year ago

anshulxyz commented 2 years ago

As seen requested here https://github.com/openzim/cms/pull/37#discussion_r759310873

Add is_valid_langcode() utility method to i18n.py, that returns a boolean on wether something is a valid language code or not

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

rgaudin commented 1 year ago

i18n.get_language_details with failsafe already serves this purpose.

We now have i18n.is_valid_iso_639_3 that we use. I'm in favor of having a is_valid_iso_639_2 as well as soon as the need arise.