> So you think you are in a position not only to describe, but even to prescribe
> the users of every language what they should translate and what not? I tend to
> think that our translators should decide themselves.

I now found out, that in Cyrillic one uses instead of e.g. "cm" "см", so I was wrong that is shouldn't be translatable.

But for zh_TW, pt, and hu the translation is wrong, according to their 
Wikipedias. The problem is that
lib/ui/stdtoolbars.inc:484 src/lengthcommon.cpp:38
uses the same string, but stdtoolbars is speaking about the Greek character, lenghtcommon about the unit.
The attached patch fixes the problem (we had the same case for "cc" some time 
ago.) OK to go in?

> I don't understand why you just simply go ahead and implement a proper
> comparision.

I want to be sure that this won't cover another bug. While do so I found another problem and a fix. Not too bad ;-)

Attached is the patch that compares against the untranslatable unit_name.

regards Uwe
Index: frontends/qt4/GuiHSpace.cpp
===================================================================
--- frontends/qt4/GuiHSpace.cpp	(revision 28092)
+++ frontends/qt4/GuiHSpace.cpp	(working copy)
@@ -78,6 +78,8 @@
 
 	// remove the %-items from the unit choice
 	unitCO->noPercents();
+	// remove the unit "mu" because it is not allowed by \hspace
+	unitCO->noMu();
 }
 
 
Index: frontends/qt4/GuiVSpace.cpp
===================================================================
--- frontends/qt4/GuiVSpace.cpp	(revision 28092)
+++ frontends/qt4/GuiVSpace.cpp	(working copy)
@@ -79,6 +79,8 @@
 
 	// remove the %-items from the unit choice
 	unitCO->noPercents();
+	// remove the unit "mu" because it is not allowed by \vspace
+	unitCO->noMu();
 }
 
 
Index: frontends/qt4/LengthCombo.cpp
===================================================================
--- frontends/qt4/LengthCombo.cpp	(revision 28092)
+++ frontends/qt4/LengthCombo.cpp	(working copy)
@@ -62,7 +62,7 @@
 {
 	int num = QComboBox::count();
 	for (int i = 0; i < num; i++) {
-		if (QComboBox::itemText(i).contains('%') > 0) {
+		if (QComboBox::itemText(i).contains('%')) {
 			QComboBox::removeItem(i);
 			--i;
 			--num;
@@ -70,4 +70,16 @@
 	}
 }
 
+void LengthCombo::noMu()
+{
+	int num = QComboBox::count();
+	for (int i = 0; i < num; i++) {
+		if (lyx::unit_name[i] == "mu") {
+			QComboBox::removeItem(i);
+			--i;
+			--num;
+		}
+	}
+}
+
 #include "LengthCombo_moc.cpp"
Index: frontends/qt4/LengthCombo.h
===================================================================
--- frontends/qt4/LengthCombo.h	(revision 28092)
+++ frontends/qt4/LengthCombo.h	(working copy)
@@ -38,6 +38,8 @@
 	virtual void setEnabled(bool b);
 	/// use the %-items?
 	virtual void noPercents();
+	/// use the "mu" item?
+	virtual void noMu();
 
 protected Q_SLOTS:
 	virtual void has_activated(int index);
Index: lengthcommon.cpp
===================================================================
--- lengthcommon.cpp	(revision 28092)
+++ lengthcommon.cpp	(working copy)
@@ -35,7 +35,7 @@
 // the LyX gui units
 char const * const unit_name_gui[] = {
 	N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"),
-	N_("cc[[unit of measure]]"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"),
+	N_("cc[[unit of measure]]"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu[[unit of measure]]"),
 	N_("Text Width %"), N_("Column Width %"), N_("Page Width %"), N_("Line Width %"),
 	N_("Text Height %"), N_("Page Height %"), "" };
 

Reply via email to