]> 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:36:58 +0000 (11:36 -0400)
(cherry picked from commit 3057bce3f210584118211746d8e38bec9d76a080)

src/Paragraph.cpp
src/insets/InsetRef.cpp
status.20x

index c12f9ca0553c87738c371266d212a6eff3443d04..3b35db3f5fa69bfafc971307e04c097544ef6ac6 100644 (file)
@@ -2787,6 +2787,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 6571ba7f99619f9a5e48bb13e35727919926aef2..54779f0790e5e5af7cb684c7e232ac66fe31913d 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"
@@ -201,7 +202,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);
@@ -218,9 +219,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"
index b23a76f41b4aa5fd63537df1254da19007555a83..15396173849e2f256e7cadc13256f55833ff141e 100644 (file)
@@ -116,9 +116,7 @@ What's new
 
 - Reset counters properly when outputting included XHTML files (bug 8598).
 
-- Translate "elsewhere" to the Buffer language when outputting XHTML.
-  This is not quite right, but it is better than translating it to the
-  UI language (partial fix for #8587).
+- Translate "elsewhere" when outputting XHTML (bug 8587).
 
 
 * USER INTERFACE