python-babel / babel

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

Support for Haitian Creole ? ht ? #699

Open hackatechs opened 4 years ago

hackatechs commented 4 years ago

This code is fail :($ pybabel init -i ./babel/messages.pot -d ./webapp/translations -l ht What's wrong with haitian creole ?

jeancochrane commented 3 years ago

@hackatechs Did you ever get an answer to this question? I also need to support Haitian Creole and am noticing that it's not supported by Locale.parse():

In [12]: Locale.parse('ht')
---------------------------------------------------------------------------
UnknownLocaleError                        Traceback (most recent call last)
<ipython-input-12-b51394ebf382> in <module>
----> 1 Locale.parse('ht')

~/.virtualenvs/remit-srv/lib/python3.8/site-packages/babel/core.py in parse(cls, identifier, sep, resolve_likely_subtags)
    329                 return locale
    330
--> 331         raise UnknownLocaleError(input_id)
    332
    333     def __eq__(self, other):

UnknownLocaleError: unknown locale 'ht'

This in spite of the fact that ht is a support source ID for Haitian Creole according to the CLDR likely subtags.