Hi,

this patch fixes localization for clear (double) page. I will commit as soon as compilation is completed and I can check the patch.

BTW: I find it quite confusing that clearpage is derived from pagebreak. There should be some "empty" base class from which all three command classes are derived.

Michael
Index: insetpagebreak.C
===================================================================
--- insetpagebreak.C	(Revision 16038)
+++ insetpagebreak.C	(Arbeitskopie)
@@ -53,8 +53,6 @@
 
 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 {
-	docstring const label = _(insetLabel());
-
 	LyXFont font;
 	font.setColor(LColor::pagebreak);
 	font.decSize();
@@ -62,12 +60,12 @@
 	int w = 0;
 	int a = 0;
 	int d = 0;
-	theFontMetrics(font).rectText(label, w, a, d);
+	theFontMetrics(font).rectText(insetLabel(), w, a, d);
 
 	int const text_start = int(x + (dim_.wid - w) / 2);
 	int const text_end = text_start + w;
 
-	pi.pain.rectText(text_start, y + d, label, font,
+	pi.pain.rectText(text_start, y + d, insetLabel(), font,
 		LColor::none, LColor::none);
 
 	pi.pain.line(x, y, text_start, y,
Index: insetpagebreak.h
===================================================================
--- insetpagebreak.h	(Revision 16038)
+++ insetpagebreak.h	(Arbeitskopie)
@@ -14,6 +14,7 @@
 
 
 #include "inset.h"
+#include "gettext.h"
 
 
 namespace lyx {
@@ -45,7 +46,7 @@
 
 	bool display() const { return true; }
 
-	virtual std::string insetLabel() const { return "Page Break"; }
+	virtual docstring insetLabel() const { return _("Page Break"); }
 
 	virtual std::string getCmdName() const { return "\\newpage"; }
 
@@ -61,7 +62,7 @@
 public:
 	InsetClearPage() {}
 
-	std::string insetLabel() const { return "Clear Page"; }
+	docstring insetLabel() const { return _("Clear Page"); }
 	
 	std::string getCmdName() const { return "\\clearpage"; }
 
@@ -77,7 +78,7 @@
 public:
 	InsetClearDoublePage() {}
 
-	std::string insetLabel() const { return "Clear Double Page"; }
+	docstring insetLabel() const { return _("Clear Double Page"); }
 	
 	std::string getCmdName() const { return "\\cleardoublepage"; }
 

Reply via email to