More generally how do you rename Sphinx default elements (e.g. Quick Search
to Search
)? Can you?
Here is how you could change "Quick search" to something else by overriding a template:
Create a folder called templates
in the Sphinx project directory.
Copy <Sphinx install dir>/themes/basic/searchbox.html
to templates
.
In conf.py, add
templates_path = ["templates"]
Rename 'Quick search' to whatever you want in the copy of searchbox.html
.
But I would not do it this way.
A more flexible approach is to create a gettext MO file and set up the configuration as described in the documentation for locale_dirs. Like this:
The template file <Sphinx install dir>/locale/sphinx.pot
contains all the strings that can be translated. Copy that file to a local sphinx.po
file.
Add your changes to sphinx.po
.
Use msgfmt.py to compile sphinx.po
into sphinx.mo
.
Put sphinx.mo
in the proper directory (<your_locale_dir>/en/LC_MESSAGES
for English).
See also http://docs.python.org/library/gettext.html#internationalizing-your-programs-and-modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With