More generally how do you rename Sphinx default elements (e.g. Quick Search to Search)? Can you?
More generally how do you rename Sphinx default elements (e.g. Quick Search to Search
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is how you could change “Quick search” to something else by overriding a template:
Create a folder called
templatesin the Sphinx project directory.Copy
<Sphinx install dir>/themes/basic/searchbox.htmltotemplates.In conf.py, add
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.potcontains all the strings that can be translated. Copy that file to a localsphinx.pofile.Add your changes to
sphinx.po.Use msgfmt.py to compile
sphinx.pointosphinx.mo.Put
sphinx.moin the proper directory (<your_locale_dir>/en/LC_MESSAGESfor English).See also http://docs.python.org/library/gettext.html#internationalizing-your-programs-and-modules.