Merge pull request #5135 from jfbu/5133_latex_index_itln

Fix: #5133 via ``\sphinxsymbolsname``, ``\sphinxnumbersname``
This commit is contained in:
Jean-François B
2018-07-16 09:21:21 +02:00
committed by GitHub
4 changed files with 18 additions and 8 deletions

View File

@@ -152,6 +152,7 @@ Bugs fixed
* #4945: i18n: fix lang_COUNTRY not fallback correctly for IndexBuilder. Thanks
to Shengjing Zhu.
* #4983: productionlist directive generates invalid IDs for the tokens
* #5133: latex: index headings "Symbols" and "Numbers" not internationalized
Testing
--------

View File

@@ -3,11 +3,11 @@ headings_flag 1
heading_prefix " \\bigletter "
preamble "\\begin{sphinxtheindex}
\\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}}
\\let\\bigletter\\sphinxstyleindexlettergroup
"
postamble "\n\n\\end{sphinxtheindex}\n"
symhead_positive "{Symbols}"
numhead_positive "{Numbers}"
symhead_positive "{\\sphinxsymbolsname}"
numhead_positive "{\\sphinxnumbersname}"

View File

@@ -470,6 +470,9 @@
{\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}%
{}% else clause of \ltx@ifundefined
% redefined in preamble, headings for makeindex produced index
\newcommand*{\sphinxsymbolsname}{}
\newcommand*{\sphinxnumbersname}{}
%% COLOR (general)
%
@@ -1592,9 +1595,10 @@
% additional customizable styling
% FIXME: convert this to package options ?
\protected\def\sphinxstyleindexentry #1{\texttt{#1}}
\protected\def\sphinxstyleindexextra #1{ \emph{(#1)}}
\protected\def\sphinxstyleindexpageref #1{, \pageref{#1}}
\def\sphinxstyleindexentry #1{\texttt{#1}}
\def\sphinxstyleindexextra #1{ \emph{(#1)}}
\def\sphinxstyleindexpageref #1{, \pageref{#1}}
\def\sphinxstyleindexlettergroup #1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
\protected\def\sphinxstyletopictitle #1{\textbf{#1}\par\medskip}
\let\sphinxstylesidebartitle\sphinxstyletopictitle
\protected\def\sphinxstyleothertitle #1{\textbf{#1}}

View File

@@ -673,6 +673,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
) +
self.babel_renewcommand(
'\\literalblockcontinuesname', self.encode(_('continues on next page'))
) +
self.babel_renewcommand(
'\\sphinxsymbolsname', self.encode(_('Symbols'))
) +
self.babel_renewcommand(
'\\sphinxnumbersname', self.encode(_('Numbers'))
)
)
self.elements['pageautorefname'] = \
@@ -856,8 +862,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def generate(content, collapsed):
# type: (List[Tuple[unicode, List[Tuple[unicode, unicode, unicode, unicode, unicode]]]], bool) -> None # NOQA
ret.append('\\begin{sphinxtheindex}\n')
ret.append('\\def\\bigletter#1{{\\Large\\sffamily#1}'
'\\nopagebreak\\vspace{1mm}}\n')
ret.append('\\let\\bigletter\\sphinxstyleindexlettergroup\n')
for i, (letter, entries) in enumerate(content):
if i > 0:
ret.append('\\indexspace\n')