Skip to content

Commit b85739d

Browse files
committed
Prevent overriding default Sphinx plural rules in JS catalog
1 parent 4269a8e commit b85739d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎babel_runner.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ def compile_js_catalog(pofile: Path) -> None:
151151
)
152152
jsfile.write_text(
153153
f"// {DOMAIN} translations for {pofile.parents[1].name}\n"
154-
f"Documentation.addTranslations({serialized});\n",
154+
f"// prevent overriding default Sphinx plural rules"
155+
"const previousPlural = Documentation.PLURAL_EXPR;\n"
156+
f"Documentation.addTranslations({serialized});\n"
157+
"Documentation.PLURAL_EXPR = previousPlural;\n",
155158
encoding="utf-8",
156159
)
157160

0 commit comments

Comments
 (0)