From a93a8cd393e3e652b015528f89b728d4adec86e8 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 23 Mar 2013 09:10:01 -0400 Subject: [PATCH] Fix a few more translation probelms for XHTML output. --- src/insets/InsetFloatList.cpp | 11 +++++++---- src/insets/InsetIndex.cpp | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index fcaf1b36c4..0f849b24ee 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -171,7 +171,7 @@ int InsetFloatList::plaintext(odocstringstream & os, } -docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const { +docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const { FloatList const & floats = buffer().params().documentClass().floats(); FloatList::const_iterator cit = floats[to_ascii(getParam("type"))]; @@ -193,17 +193,20 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const { string const type = cit->second.floattype(); if (type == "table") { toctype = "table"; - toclabel = _("List of Tables"); + toclabel = translateIfPossible(from_ascii("List of Tables"), + op.local_font->language()->lang()); } else if (type == "figure") { toctype = "figure"; - toclabel = _("List of Figures"); + toclabel = translateIfPossible(from_ascii("List of Figures"), + op.local_font->language()->lang()); } else { LYXERR0("Unknown Builtin Float!"); return docstring(); } } else { toctype = to_utf8(getParam("type")); - toclabel = buffer().B_(cit->second.listName()); + toclabel = translateIfPossible(from_utf8(cit->second.listName()), + op.local_font->language()->lang()); } // FIXME Do we need to check if it exists? If so, we need a new diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 0d2230d5bd..043f58eeb9 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -22,6 +22,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "IndicesList.h" +#include "Language.h" #include "LaTeXFeatures.h" #include "Lexer.h" #include "output_latex.h" @@ -698,7 +699,7 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const Layout const & lay = bp.documentClass().htmlTOCLayout(); string const & tocclass = lay.defaultCSSClass(); - string const tocattr = "class='tochead " + tocclass + "'"; + string const tocattr = "class='index tochead " + tocclass + "'"; // we'll use our own stream, because we are going to defer everything. // that's how we deal with the fact that we're probably inside a standard @@ -706,9 +707,10 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const odocstringstream ods; XHTMLStream xs(ods); - xs << html::StartTag("div", "class='index'"); + xs << html::StartTag("div", tocattr); xs << html::StartTag(lay.htmltag(), lay.htmlattr()) - << _("Index") + << translateIfPossible(from_ascii("Index"), + op.local_font->language()->lang()) << html::EndTag(lay.htmltag()); xs << html::StartTag("ul", "class='main'"); Font const dummy; -- 2.39.5