Pāli language missing.
So, pi is the ISO_639-1 language code for the Pāli language, yet
>>> import babel
>>> babel.__version__
'2.7.0'
>>> babel.Locale.parse('pi_PI')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/…/lib/python3.7/site-packages/babel/core.py", line 331, in parse
raise UnknownLocaleError(input_id)
babel.core.UnknownLocaleError: unknown locale 'pi_PI'
>>> babel.Locale.parse('pi')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/…/lib/python3.7/site-packages/babel/core.py", line 331, in parse
raise UnknownLocaleError(input_id)
babel.core.UnknownLocaleError: unknown locale 'pi'
I’m not sure what’s required to add a new locale here, but would it be possible to add Pāli? Happy to submit a PR if somebody can give me pointers.
All the locale data in Babel comes from the Unicode CLDR (at least until some planned custom overlays etc. are implemented).
I couldn't find an issue for Pāli in the CLDR issue tracker, so you may wish to follow the procedure to request a new locale.
Thanks for the tip, @akx! I’ve opened CLDR-13555, and I guess we’ll just have to wait and see what happens next?
Feel free to close this one.
@akx, hmm, looking at en.xml of the CLDR then both Pāli (pi) and Latin (la) are defined, yet:
>>> import babel
>>> babel.__version__
'2.8.0'
>>> babel.Locale('la')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/…/lib/python3.7/site-packages/babel/core.py", line 168, in __init__
raise UnknownLocaleError(identifier)
babel.core.UnknownLocaleError: unknown locale 'la'
>>> babel.Locale('pi')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/…/lib/python3.7/site-packages/babel/core.py", line 168, in __init__
raise UnknownLocaleError(identifier)
babel.core.UnknownLocaleError: unknown locale 'pi'
What am I missing here?
You're looking at the list of language names in English, which is generally accessible with Locale.get_language_name()... but that API unfortunately doesn't work for languages that aren't available for Babel, so you'd have to look at the underlying languages dict instead to access that data:
>>> en = babel.Locale.parse("en")
>>> en.languages.get('pi')
'Pali'
>>> en.languages.get('la')
'Latin'
@akx, thank you! Is the display name available as well? From the docs:
Locales itself can be used to describe the locale itself or other locales.
So I guess without having a Locale object for Pāli or Sanskrit I won’t be able to access their respective display names?
Well, you could compose something akin to a display name from a language name and territory name (l.languages and l.territories), if you know the territory that language is spoken in.
@jenstroeger CLDR ticket was closed due to no further data
Can this be closed, its upstream.
Can this be closed, its upstream.
@StanFromIreland oh, this has rolled out?
Can this be closed, its upstream.
@StanFromIreland oh, this has rolled out?
Hi @jenstroeger - actually, we closed it because we didn't hear back from you (Hello!) 👋
There's an online form now, at https://cldr.unicode.org/index/cldr-spec/core-data-for-new-locales - can you fill that out and mention CLDR-13555 ?
Hi @jenstroeger - actually, we closed it because we didn't hear back from you (Hello!) 👋
Oh dear… Hello!
There's an online form now, at https://cldr.unicode.org/index/cldr-spec/core-data-for-new-locales - can you fill that out and mention CLDR-13555 ?
That’s the “Core data needed for new CLDR locale” form?
Hi @jenstroeger - actually, we closed it because we didn't hear back from you (Hello!) 👋
Oh dear… Hello!
Hello again! Hey, it's still the same decade as last time!
There's an online form now, at https://cldr.unicode.org/index/cldr-spec/core-data-for-new-locales - can you fill that out and mention CLDR-13555 ?
That’s the “Core data needed for new CLDR locale” form?
The very same.
Hello again! Hey, it's still the same decade as last time!
Hello again @srl295, and hooray that I didn’t slack off for too long!
I just responded to CLDR-13555 which should, once addressed, bleed into this package, correct?
Hello again! Hey, it's still the same decade as last time!
Hello again @srl295, and hooray that I didn’t slack off for too long!
I just responded to CLDR-13555 which should, once addressed, bleed into this package, correct?
Yes, form filled out, data filled in, and so on, this is a good time because data collection will be starting soon
Hello again! Hey, it's still the same decade as last time!
Hello again @srl295, and hooray that I didn’t slack off for too long!
I just responded to CLDR-13555 which should, once addressed, bleed into this package, correct?
Yes, form filled out, data filled in, and so on, this is a good time because data collection will be starting soon
Adding for reference: https://github.com/unicode-org/cldr/pull/4631