]> git.lyx.org Git - features.git/commitdiff
Fix bug #8587 properly, by using local language for translation.
authorRichard Heck <rgheck@lyx.org>
Tue, 19 Mar 2013 15:30:09 +0000 (11:30 -0400)
committerRichard Heck <rgheck@lyx.org>
Tue, 19 Mar 2013 15:30:36 +0000 (11:30 -0400)
src/Paragraph.cpp
src/insets/InsetRef.cpp

index e803ac50365688fc2ec6ec4cec777f6379412385..75dbff36f4f004af0dd705baf3d9cfd4f6c533b4 100644 (file)
@@ -2890,6 +2890,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
                if (inset) {
                        if (!runparams.for_toc || inset->isInToc()) {
                                OutputParams np = runparams;
+                               np.local_font = &font;
                                if (!inset->getLayout().htmlisblock())
                                        np.html_in_par = true;
                                retval += inset->xhtml(xs, np);
index 9bfb3d488c03806ef6a7b9baf1b5e076b521712e..9a2ddd8bd8aec618719ba9c4b7bb561d1564a2ca 100644 (file)
@@ -16,6 +16,7 @@
 #include "Cursor.h"
 #include "DispatchResult.h"
 #include "InsetLabel.h"
+#include "Language.h"
 #include "LaTeXFeatures.h"
 #include "LyX.h"
 #include "OutputParams.h"
@@ -206,7 +207,7 @@ int InsetRef::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
-docstring InsetRef::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetRef::xhtml(XHTMLStream & xs, OutputParams const & op) const
 {
        docstring const & ref = getParam("reference");
        InsetLabel const * il = buffer().insetLabel(ref);
@@ -223,9 +224,8 @@ docstring InsetRef::xhtml(XHTMLStream & xs, OutputParams const &) const
                        display_string = value;
                else if (cmd == "pageref" || cmd == "vpageref")
                        // normally would be "on page #", but we have no pages.
-                       // FIXME this is wrong, as it should be the current language,
-                       // but it is better than _(), which is what we had before.
-                       display_string = buffer().B_("elsewhere");
+                       display_string = translateIfPossible(from_ascii("elsewhere"),
+                               op.local_font->language()->lang());
                else if (cmd == "eqref")
                        display_string = '(' + value + ')';
                else if (cmd == "formatted")