python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.34k stars 448 forks source link

Wrong language name for `zh_TW` (Taiwanese) #1117

Open SirRob1997 opened 3 months ago

SirRob1997 commented 3 months ago

The language name for Taiwanese (zh_TW) seems to be wrongly given as Chinese and also the regular locale creation doesnt work as expected:

>>> Locale('zh_TW').get_language_name('en_US')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/envs/poetry/lib/python3.9/site-packages/babel/core.py", line 204, in __init__
    raise UnknownLocaleError(identifier)
babel.core.UnknownLocaleError: unknown locale 'zh_TW'
>>> Locale.parse('zh_TW')
Locale('zh', territory='TW', script='Hant')
>>> Locale.parse('zh_TW').get_language_name('en_US')
Chinese

As regular "Chinese" I'd classify simplified Han script (Mandarin) while Taiwanese uses traditional Han script.