| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The 'a' format token was returning the literal string 'a' instead of a lowercase meridiem indicator (am/pm). Only the uppercase 'A' token was handled in _format_localizable_token, so 'a' fell through to the default branch that returns the token unchanged. This also broke round-tripping: the parser already expects lowercase am/pm for the 'a' token, but formatting produced 'a' instead.
|
I hit this same bug independently and opened #990 before noticing yours, so I'm closing mine as a duplicate since this one came first. One addition that might help it land: the format-token docs table in docs/docs/string_formatting.md lists A but not a, so it's worth adding an a row there too: | | a | am, pm | Happy to push that to your branch if useful, or you can grab it from #990. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The a format token returns the literal string a instead of a lowercase meridiem indicator (am/pm).
_format_localizable_token only handles the uppercase A token, so a falls through to the default branch that returns the token unchanged. The a token is documented and registered in the token regex, and the parser side already treats it as a lowercase meridiem, so formatting and parsing were inconsistent and a value formatted with a could not be round-tripped:
previously failed because the formatted string contained a literal a rather than pm.
This mirrors the existing A branch and lowercases the result for the a token. Added a regression test alongside the existing test_am_pm.