Skip to content

Compile compact exponent operands for gettext and JavaScript plural rules - #1440

Open
shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/plural-exponent
Open

shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/plural-exponent

Conversation

@shrohan2003

Copy link
Copy Markdown

Generated gettext expressions can contain an undeclared e or c, which makes them invalid for gettext. The JavaScript generator inherits the same problem. For example, compiling e = 0 and n = 1 raises an invalid-token error when used with Python’s gettext evaluator.

Both compilers now use zero for the compact exponent of an ordinary number, matching Babel’s Python evaluator. Tests exercise both operand spellings and evaluate the generated gettext expression.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant