noumar / iso639

ISO 639 library for Python
GNU Affero General Public License v3.0
32 stars 11 forks source link

Gaelic language (iso639-1 code) isn't working correctly #6

Closed shasha79 closed 5 years ago

shasha79 commented 5 years ago

import iso639 iso639.to_iso639_1("ga") ''

Similarly structured Galician (gl) works correctly

iso639.to_iso639_1("gl") 'gl'

Not sure what the problem is

noumar commented 5 years ago

Thanks for the bug report @shasha79. Unfortunately this is the wrong iso639 project. You should file the bug at https://github.com/janpipek/iso639-python.

Let me take this opportunity to mention that your problem works with this project's library. This library also covers more.

$ pip install iso-639
>>> import iso639
>>> vars(iso639.languages.get(part1="ga"))
{'inverted': 'Irish',
 'macro': '',
 'name': 'Irish',
 'names': [],
 'part1': 'ga',
 'part2b': 'gle',
 'part2t': 'gle',
 'part3': 'gle',
 'part5': ''}
>>> vars(iso639.languages.get(part1="gd"))
{'inverted': 'Gaelic, Scottish',
 'macro': '',
 'name': 'Scottish Gaelic',
 'names': [('Gaelic', 'Gaelic')],
 'part1': 'gd',
 'part2b': 'gla',
 'part2t': 'gla',
 'part3': 'gla',
 'part5': ''}
>>> vars(iso639.languages.get(part1="gl"))
{'inverted': 'Galician',
 'macro': '',
 'name': 'Galician',
 'names': [],
 'part1': 'gl',
 'part2b': 'glg',
 'part2t': 'glg',
 'part3': 'glg',
 'part5': ''}

Please have a try, and if you would like to contribute to the project please feel welcome to file pull request or more issues. Thanks again.