Comments (4)
(issue labels updated; let me know if those seem accurate/inaccurate)
from sphinx.
What did I miss? Is this a bug? Or Is Sphinx's gettext builder designed to be unable to extract
option
directive? Or is it just not able to do it currently, and is required a feature request?
Sphinx's gettext builder is currently explicitly designed to ignore certain strings by default, such as code-blocks, or the option
directive. Though some have been added as optional additional targets, it is usually useful to ignore them as these are strings that are likely not to be changed by translations.
The option
directive simply hasn't been yet added as a possible additional target. But it would not be trivial to add as it is also a cross-reference target, so it would be quite difficult to make it work correctly if the option name is changed in the translations.
from sphinx.
Hello, @n-peugnet
The
option
directive simply hasn't been yet added as a possible additional target. But it would not be trivial to add as it is also a cross-reference target, so it would be quite difficult to make it work correctly if the option name is changed in the translations.
What about translating the entry which cross-references the option
directive with the following form:
# Source (msgid)
:option:`--graphviz=<file>`
# Translation (msgstr)
:option:`--graphviz=<檔案> <--graphviz=<file>>`
Just like the way CMake Documentation did in its cmake.1.rst
:manual:`CMake Presets <cmake-presets(7)>`
Is it possible to do so?
from sphinx.
What about translating the entry which cross-references the
option
directive with the following form:# Source (msgid) :option:`--graphviz=<file>` # Translation (msgstr) :option:`--graphviz=<檔案> <--graphviz=<file>>`
Translating the option role and adding an explicit target should already possible. You were initially talking about the option directive.
Maybe a simple way to do it would be to only extract the option's example value (=<file>
in your initial example), as it seems like is is already treated differently from the rest, and changing it should not affect the cross-referencing (it is not mandatory in the option role). But I didn't check the code yet, so not sure how complicated it would be and if it really is a good idea.
Anyway, this should be tagged as a feature request as this is not a bug, but I don't have the permissions to change the tags myself.
from sphinx.
Related Issues (20)
- Sphinx v7.4.0: Failed to get a method signature: unhashable type HOT 6
- Sphinx v7.3.7: AttributeError: 'Symbol' object has no attribute '_children' HOT 10
- Sphinx 7.4.0 breaks parsing of MyST-Parser (and probably others) configuration in conf.py HOT 4
- Warning about duplicate definitions in intersphinx mapping HOT 5
- New warning in version 7.4 from autosummary causing automated builds to fail HOT 18
- Regression in 7.4: `jinja2.exceptions.TemplateNotFound` error from `jinja2glue` HOT 3
- LaTeX regression for admonitions HOT 15
- Running make gettext fails with TypeError HOT 1
- [HTML search] Bug: 'indexentries' section missing results from search index following non-fresh project rebuild. HOT 1
- Sphinx 7.4: autodoc: ``typing.Annotated`` failure with pydantic HOT 12
- Python 3.8: `typing_extensions.Annotated` annotations not rendered correctly. HOT 1
- [HTML search] Optimization: write zero/one instead (one character) instead of true/false (four/five characters) for bool flags. HOT 1
- [HTML search] Test suite: ranking check should ensure that all entries are found.
- Exponential Increase in Build Time with Multiple :numref: References and Custom-Extension Tables HOT 2
- multiple definitions for std:label:python--m-build--v HOT 14
- Two failed tests (test_build_htmlhelp and test_htmlhelp_hhc) HOT 3
- Babel reports errors in the Tamil and Chinese (China) translation files HOT 4
- 8.0.0 release plan HOT 24
- sphinx-build -M not listed in sphinx-build --help HOT 1
- <short description for the feature>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx.