sphinx-doc / sphinx-doc/sphinx

VersionChange directives (changeset) do not allow translating punctuations

Open
#9,484 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.

The VersionChange directives (versionadded, versionchanged, deprecated) use hardcoded punctuations formatting '%s: ' % text and '%s.' % text, which ends up looking weird in Chinese and Japanese where full-width colon ":" and fullstop "。" are usually expected.

https://github.com/sphinx-doc/sphinx/blob/f9941b9402821de2d60c1e94f9ac5cf0379640d0/sphinx/domains/changeset.py#L88

Describe the solution you'd like

These punctuations should be made translatable in some way.

Describe alternatives you've considered

n/a

Additional context

  • [e.g. URL or Ticket]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sphinx/domains/changeset.py around line 88, where the VersionChange directives format their punctuation. Inspect how Sphinx makes directive text translatable, then apply that approach to the punctuation used by versionadded, versionchanged, and deprecated. Done means Chinese and Japanese translations can use full-width punctuation without changing the default formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, internationalization, localization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.