sphinx-doc / sphinx-doc/sphinx
Incorrect plurals in string "%d source files given on command line"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
The above code assumes the placeholder %d is plural, but it can be singular. This causes a weird rendered sentence of "1 source files...".
Besides, different languages have different plural rules, so the best would be to make this a ngettext / plural-form string so that the translator can translate correctly for number of plurals their language has.
How to Reproduce
- Run: sphinx-build -M html . _build any_source_file
- See an output like:
...
building [html]: 1 source files given on command line
...
Environment Information
Platform: linux; (Linux-6.10.10-arch1-1-x86_64-with-glibc2.40)
Python version: 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805])
Python implementation: CPython
Sphinx version: 8.0.2
Docutils version: 0.21.2
Jinja2 version: 3.1.4
Pygments version: 2.18.0
Sphinx extensions
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at sphinx/builders/init.py lines 298-299 and reproduce the output with sphinx-build -M html . _build and a single source file. Check how the message is translated and represented in the project's tests or localization workflow. Done means the singular output is grammatically correct and the message supports language-specific plural forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100