Skip to content

fix: use correct singular/plural forms for source file count strings#14456

Open
jaythehardcoder wants to merge 1 commit into
sphinx-doc:masterfrom
jaythehardcoder:fix-plural-ngettext
Open

fix: use correct singular/plural forms for source file count strings#14456
jaythehardcoder wants to merge 1 commit into
sphinx-doc:masterfrom
jaythehardcoder:fix-plural-ngettext

Conversation

@jaythehardcoder
Copy link
Copy Markdown

Summary

The build status messages for build_specific and build_update use hardcoded plural strings ("%d source files given on command line") even when the count is 1, producing grammar errors like "1 source files given on command line".

Fix

Use conditional string selection so the correct singular/plural form is used based on the actual file count:

  • "1 source file given on command line" for a single file
  • "%d source files given on command line" for multiple files
  • Same treatment for the build_update summary string

Test Plan

  • New test test_build_specific_single_file verifies the singular case
  • Existing test_build_specific (multi-file) still passes
  • 9/9 tests pass in tests/test_application.py

Closes #12903

The build_specific and build_update summary messages used hardcoded
plural strings even when the count was 1, producing grammar errors
like "1 source files given on command line".

This fix uses conditional string selection to produce correct
singular/plural forms based on the actual file count.

Fixes sphinx-doc#12903
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.

Incorrect plurals in string "%d source files given on command line"

1 participant