New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"B" symbol in pattern of dayperiod is not supported #866
Comments
Only >>> import babel
>>> babel.__version__
'2.10.1'
>>> from babel.localedata import locale_identifiers
>>> from babel import dates
>>> for locale in locale_identifiers():
... for format_ in formats:
... pattern = dates.get_time_format(format=format_, locale=locale)
... if 'b' in pattern.pattern or 'B' in pattern.pattern:
... print(locale, width, pattern)
...
zh_Hant_TW full Bh:mm:ss [zzzz]
zh_Hant_TW full Bh:mm:ss [z]
zh_Hant_TW full Bh:mm:ss
zh_Hant_TW full Bh:mm
zh_Hant full Bh:mm:ss [zzzz]
zh_Hant full Bh:mm:ss [z]
zh_Hant full Bh:mm:ss
zh_Hant full Bh:mm I noticed TODO comments for the https://github.com/python-babel/babel/blob/v2.10.1/babel/dates.py#L1316-L1318 |
Thanks for the bug report and analysis. A PR would be appreciated! |
Okay. I'm trying to fix it.... Hmm, I found the following change has been applied to - assert dates.format_time(datetime(2016, 4, 8, 12, 34, 56), locale='zh_TW') == u'\u4e0b\u534812:34:56'
+ assert dates.format_time(datetime(2016, 4, 8, 12, 34, 56), locale='zh_TW') == u'B12:34:56' |
That's an oversight on my part, sorry. I should have realized the B is wrong there. That test change should of course be reverted once the B character is supported. |
I've posted pull request #869 for this issue. |
Closed via #869. Thank you! |
Overview Description
(Originally reported in https://trac.edgewall.org/ticket/13482, running unit tests in Trac with Babel 2.10.1)
Since Babel 2.10.0 (CLDR 41),
B
symbol is used in datetime pattern forzh_Hant
locale, however Babel doesn't support theB
symbol.Steps to Reproduce
Actual Results
The
B
symbol is not formatted.Expected Results
The
B
symbol should be formatted to上午
(am) or下午
(pm).Reproducibility
100%
Additional Information
n/a
The text was updated successfully, but these errors were encountered: