-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gettext builder cannot extract 'option' directive #12383
Comments
Sphinx's gettext builder is currently explicitly designed to ignore certain strings by default, such as code-blocks, or the The |
Hello, @n-peugnet
What about translating the entry which cross-references the # Source (msgid)
:option:`--graphviz=<file>`
# Translation (msgstr)
:option:`--graphviz=<檔案> <--graphviz=<file>>` Just like the way CMake Documentation did in its :manual:`CMake Presets <cmake-presets(7)>` Is it possible to do so? |
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 ( 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. |
(issue labels updated; let me know if those seem accurate/inaccurate) |
Describe the bug
Hello, Sphinx Maintainance Team.
Recently, I tried to translate CMake Documentation with its .po files generated by Gettext builder. In CMake Documentation, we can see that there is a type of content derived from the Sphinx
option
directive. Take cmake's--graphviz=<file>
as an example:.html
link:--graphviz=<file>
.rst
link:--graphviz=<file>
If possible, I want to translate the
<file>
in the--graphviz=<file>
as well. However, I found that even though I specify all the possible values ingettext_additional_targets
when building with gettext builder:I still don't see the content of
option
directives being extracted into the generatedcmake.1.pot
.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?How to Reproduce
Run the following commands in order:
git clone --depth=1 --branch=v3.28.4 https://github.com/Kitware/CMake.git cd CMake cmake -D SPHINX_HTML=ON -S Utilities/Sphinx -B Utilities/Sphinx/build LANG=en_US.UTF-8 sphinx-build -b gettext -Dgettext_additional_targets=index,literal-block,doctest-block,raw,image -Dgettext_compact=0 -c Utilities/Sphinx/build Help Help/locale/pot kate Help/locale/pot/manual/cmake.1.pot
Search
--graphviz=<file>
string in Kate (Ctrl+F).Expected/Actual Result:
--graphviz=<file>
in thecmake.1.pot
.Environment Information
Sphinx extensions
No response
Additional context
Full log of How to Reproduce
Click to expand the full log
The text was updated successfully, but these errors were encountered: