Plural formula grammar syntax #19494
Answered
by
nijel
the-phinet
asked this question in
Q&A
|
Is there a formal definition of the grammar used in the plural formula strings? From the looks of it, they are manually added to https://github.com/WeblateOrg/language-data/blob/main/languages.csv (and the handful of other csv files), and then read directly by https://github.com/WeblateOrg/language-data/blob/main/scripts/generate-language-data.py I intend on writing some code that relies on this data. I've been unable to find any documentation on them, other than some examples in getext's docs. While the grammar is simple enough, I'd like to be sure I'm not missing anything |
Answered by
nijel
May 12, 2026
Replies: 2 comments 4 replies
|
You can check Python's implementation: It lists Gettext's source code as reference: https://cgit.git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y |
2 replies
Answer selected by
the-phinet
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can check Python's implementation:
https://github.com/python/cpython/blob/b546cc10f5c659344ce3cf49db6d9c92307ed1fc/Lib/gettext.py#L60-L229
It lists Gettext's source code as reference:
https://cgit.git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y