[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: The breadth of the freeze
From:       Jens Hoefkens <hoefkens () msu ! edu>
Date:       2001-02-09 9:12:18
[Download RAW message or body]

On Thu, 8 Feb 2001, Matthias Kiefer wrote:

> Sorry if I sound a little bit coarse, but it is just frustrating to see such 
> messages when doing translations.

Point well taken...

Matthias,

below is a proposed patch for KBackgammon that changes the I18N'ified
strings. Could you (and possibly others) please have a look at it and
critisize if necessary. If I don't get any negative comments, I will
check the patched files into CVS on Saturday.


Thanks,
Jens


diff -urb kbackgammon.vanilla/kbgboard.cpp kbackgammon/kbgboard.cpp
--- kbackgammon.vanilla/kbgboard.cpp	Fri Feb  9 03:31:42 2001
+++ kbackgammon/kbgboard.cpp	Fri Feb  9 01:20:07 2001
@@ -533,10 +533,8 @@
 	ok     = new QPushButton(i18n("OK"), this);
 	cancel = new QPushButton(i18n("Cancel"), this);
 	
-	info->setText(i18n("Set the face values of the selected dice. The other "
-			   "player's\n"
-			   "dice will be cleared and it will be the dice's "
-			   "owners turn."));
+	info->setText(i18n("Set the face values of the selected dice. The other player's\n"
+			   "dice will be cleared and it will be the dice's owners turn."));
 	
 	info->setMinimumSize(info->sizeHint());
 	
@@ -1795,8 +1793,7 @@
 KBgBoardBar::KBgBoardBar(QWidget * parent, int numID)
 	: KBgBoardCell(parent, numID)
 {
-	QWhatsThis::add(this, i18n
-			("This is the bar of the backgammon board.\n\n"
+	QWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n"
 			 "Checkers that have been kicked from the board are put "
 			 "on the bar and remain there until they can be put back "
 			 "on the board. Checkers can be moved by dragging them to "
@@ -1813,8 +1810,7 @@
 KBgBoardField::KBgBoardField(QWidget * parent, int numID)
 	: KBgBoardCell(parent, numID)
 {
-	QWhatsThis::add(this, i18n
-			("This is a regular field of the backgammon board.\n\n"
+	QWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n"
 			 "Checkers can be placed on this field and if the current state "
 			 "of the game and the dice permit this, they can be moved by "
 			 "dragging them to their destination or by using the 'short "
@@ -1828,8 +1824,7 @@
 KBgBoardHome::KBgBoardHome(QWidget * parent, int numID)
 	: KBgBoardCell(parent, numID)
 {
-	QWhatsThis::add(this, i18n
-			("This part of the backgammon board is the home.\n\n"
+	QWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n"
 			 "Depending on the direction of the game, one of the homes "
 			 "contains the dice and the other one contains checkers that "
 			 "have been moved off the board. Checkers can never be moved "
diff -urb kbackgammon.vanilla/kbgfibs.cpp kbackgammon/kbgfibs.cpp
--- kbackgammon.vanilla/kbgfibs.cpp	Fri Feb  9 03:31:42 2001
+++ kbackgammon/kbgfibs.cpp	Fri Feb  9 01:13:48 2001
@@ -179,7 +179,7 @@
 
 	fibsMenu->insertSeparator();
 
-	(invAction  = new KAction(i18n("&Invite..."),   0, this, SLOT(  inviteDialog()), \
this))->plug(fibsMenu); +	(invAction  = new KAction(i18n("&Invite..."), 0, this, \
SLOT(inviteDialog()), this))->plug(fibsMenu);  
 	/*
 	 * Create and fill the response menu. This is for all these: type this or 
@@ -647,7 +647,7 @@
 	char matchlength[4], pointsus[4], pointsthem[4];
 	int turn, cube, wasdoubled, color, direction, redoubles;
 
-	// split the incoming line at colons
+	// split the incoming line at colons - latin1() is fine, since the string comes \
from FIBS.  sscanf (line.latin1(), format,
 		player, opponent, matchlength, pointsus, pointsthem,
 		&board[ 0], &board[ 1], &board[ 2], &board[ 3],	&board[ 4], &board[ 5], 
@@ -700,16 +700,15 @@
 	/*
 	 * Create new caption string
 	 */
-	caption = player;
-	caption = caption + " (" + pointsus   + ") " + i18n("vs. ") + opponent	+ " (" + \
pointsthem + ") - ";  if (turn == 0)
-		caption += i18n("game over");
-	else {
-		if (strcmp(matchlength, "9999") == 0)
-			caption += i18n("unlimited match");
+		caption = i18n("%1 (%2) vs. %3 (%4) - game over").
+			arg(player).arg(pointsus).arg(opponent).arg(pointsthem);
+	else if (strcmp(matchlength, "9999") == 0)
+		caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").
+			arg(player).arg(pointsus).arg(opponent).arg(pointsthem);
 		else
-			caption += matchlength + i18n(" point match");
-	}
+		caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").
+			arg(player).arg(pointsus).arg(opponent).arg(pointsthem).arg(matchlength);
 
 	/*
 	 * Emit everything
@@ -754,7 +753,8 @@
 	int expi;
 	
 	/*
-	 * Extract the name of the player, her opponent, rating and experience
+	 * Extract the name of the player, her opponent, rating and experience.
+	 * It is okay to use latin1(), since the string is coming from FIBS.
 	 */
 	sscanf(info.latin1(), "%s %s %*s %*s %*s %f %i %*s %*s %*s %*s %*s", 
 	       name_p, name_o, &rate, &expi);
@@ -776,28 +776,33 @@
 	if (numJoin > -1 && oppo != "-")
 		cancelJoin(name);
 
-
 	for (QStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) \
{  
 		if ((*it).contains(patt)) {
 
-			QString text = name + i18n(" (experience ") + expi_s + i18n(", rating ") + rate_s \
                + ") ";
-			QString menu = name;
+			QString text, menu;
 			
 			if ((*it).contains(QRegExp(" r$"))) {
-				menu += " (R)";
-				text += i18n("wants to resume a saved match with you.");
+				menu = i18n("%1 (R)").arg(name);
+				text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with \
you."). +					arg(name).arg(expi_s).arg(rate_s);
 			} else if ((*it).contains(QRegExp(" u$"))) {
-				menu += " (U)";
-				text += i18n("wants to play an unlimited match with you.");
+				menu = i18n("%1 (U)").arg(name);
+				text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with \
you."). +					arg(name).arg(expi_s).arg(rate_s);
 			} else {
 				QString len = (*it).right((*it).length() - name.length() - 1);
-				menu += " (" + len + ")";
-				text += i18n("wants to play a ") + len + i18n(" point match with you.");
+				/*
+				 * there is not much to translate here. but if a translation changes the
+				 * format of the previous messages, this should be changed, too
+				 */
+				menu = i18n("%1 (%2)").arg(name).arg(len);
+				text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with \
you."). +					arg(name).arg(expi_s).arg(rate_s).arg(len);
+
 			}
 			text += i18n(" If you want to play, use the corresponding menu entry to "
-				     "join (or type ") + "'join " + name + "').";
-
+				     "join (or type 'join %1').").arg(name);
 			
 			emit serverString("rawwho " + name); // this avoids a race
 			if (whoisInvite) {
@@ -821,7 +826,6 @@
 			for (int i = 0; i <= numJoin; i++)
 				actJoin[i]->plug(joinMenu); 
 		       
-
 			invitations.remove(it);
 			break;
 		}
@@ -1118,8 +1122,7 @@
 void KBgEngineFIBS::away()
 {
 	bool ret;
-	QString msg = KLineEditDlg::getText(i18n("Please type the message that should "
-						 "be displayed to other\n"
+	QString msg = KLineEditDlg::getText(i18n("Please type the message that should be \
displayed to other\n"  "users while you are away."), 
 					    lastAway, &ret, (QWidget *)parent());
 	if (ret) {
@@ -1319,7 +1322,7 @@
 	/* 
 	 * Some visual feedback and done
 	 */
-	emit infoText(QString(i18n("Connected")) + "<br/>"); 
+	emit infoText(i18n("Connected") + "<br/>"); 
 }
 
 /*
@@ -1355,7 +1358,7 @@
 	// send two lines in case we are stuck in the login phase
 	emit serverString("quit");
 	emit serverString("quit");
-	emit infoText(QString("<br/>") + i18n("Closing connection..."));
+	emit infoText("<br/>" + i18n("Closing connection..."));
 	emit fibsConnectionClosed();
 }
 
@@ -1372,7 +1375,7 @@
 	 * Flush whatever is left in the rxBuffer and send a note
 	 */
 	emit infoText(rxCollect + "<br/><hr/>");
-	emit infoText(QString(i18n("Connection closed.")) + "<br/>");
+	emit infoText(i18n("Connection closed.") + "<br/>");
 
 	conAction->setEnabled(true);	
 	newAction->setEnabled(true);	
@@ -1398,9 +1401,8 @@
 	 */
 	if (newlogin || infoFIBS[FIBSHost].isEmpty()) {
 
-		msg = KLineEditDlg::getText(i18n("Enter the name of the server you "
-						 "want to connect to.\nThis should "
-						 "almost always be \"fibs.com\"."),
+		msg = KLineEditDlg::getText(i18n("Enter the name of the server you want to connect \
to.\n" +						 "This should almost always be \"fibs.com\"."),
 					    infoFIBS[FIBSHost], &ret, (QWidget *)parent());
 
 		if (ret)
@@ -1423,23 +1425,24 @@
 	if (newlogin || infoFIBS[FIBSUser].isEmpty()) {
 
 		if (newlogin)			
-			text = i18n("Enter the login you would like to use on the server ") 
-				+ infoFIBS[FIBSHost]
-				+ i18n(". The login may not\ncontain spaces or colons. If the "
-				       "login you choose is not available, you'll later be\ngiven "
-				       "the opportunity to pick another one.");
+
+			text = i18n("Enter the login you would like to use on the server %1. The login \
may not\n" +				    "contain spaces or colons. If the login you choose is not \
available, you'll later be\n" +				    "given the opportunity to pick another \
one.\n\n").arg(infoFIBS[FIBSHost]); +		
 		else
-			text = i18n("Enter your login on the server ") 
-				+ infoFIBS[FIBSHost]
-				+ i18n(". If you don't have a login, you\nshould create "
-				       "one using the corresponding menu option.");
+			
+			text = i18n("Enter your login on the server %1. If you don't have a login, you\n"
+				    "should create one using the corresponding menu \
option.\n\n").arg(infoFIBS[FIBSHost]); +
 
 		first = true;
 		do {
 			msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, 
 						     (QWidget *)parent())).stripWhiteSpace();
 			if (first) {
-				text += i18n("\n\nThe login may not contain spaces or colons!");
+				text += i18n("The login may not contain spaces or colons!");
 				first = false;
 			}
 
@@ -1453,23 +1456,22 @@
 	if (newlogin || infoFIBS[FIBSPswd].isEmpty()) {
 		
 		if (newlogin)			
-			text = i18n("Enter the password you would like to use with the login ") 
-				+ infoFIBS[FIBSUser]
-				+ i18n("\non the server ")
-				+ infoFIBS[FIBSHost] 
-				+ i18n(". It may not contain colons.");
+	
+			text = i18n("Enter the password you would like to use with the login %1\n"
+				    "on the server %2. It may not contain colons.\n\n").
+				arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
+
 		else
-			text = i18n("Enter the password for the login ") 
-				+ infoFIBS[FIBSUser]
-				+ i18n(" on the server ")
-				+ infoFIBS[FIBSHost] + ".";
+
+			text = i18n("Enter the password for the login %1 on the server %2.\n\n").
+				arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
 
 		first = true;
 		do {
 			msg = (KLineEditDlg::getText(text, infoFIBS[FIBSPswd], &ret, 
 						     (QWidget *)parent())).stripWhiteSpace();
 			if (first) {
-				text += i18n("\n\nThe password may not contain colons!");
+				text += i18n("The password may not contain colons!");
 				first = false;
 			}
 			
@@ -1654,7 +1656,7 @@
 				
 	default:
 		/*
-		 * This is a serious problem
+		 * This is a serious problem - latin1() is fine since the line comes from FIBS.
 		 */
 		cerr << "PROBLEM in KBgEngineFIBS::handleServerData: " << line->latin1() << endl;
 	}
@@ -1753,11 +1755,12 @@
 	if (line.contains(pat[Welcome])) {
 		char p[3][256];
 		time_t tmp;
+		// Using latin1() is okay, since the string comes from FIBS.
 		int words = sscanf (line.latin1(), "%s%s%li%s", p[0], p[1], &tmp, p[2]);
 		if (words >= 4) {
 			QDateTime d; d.setTime_t(tmp);
-			emit infoText(QString("<hr><br/>") + p[1] + ", last logged in from " 
-				      + p[2] + " at " + d.toString() + ".");
+			QString text = i18n("%1, last logged in from %2 at \
%3.").arg(p[1]).arg(p[2]).arg(d.toString()); +			emit infoText("<hr><br/>" + text);
 		}
 		return;
 	}
@@ -1800,6 +1803,8 @@
 		char p[3][256];
 		int n[12];
 		double rating;    
+		
+		// Using latin1() is okay, since the string comes from FIBS.
 		int words = sscanf (line.latin1(), \
"%s%s%i%i%i%i%i%i%i%i%i%i%i%i%i%lf%i%i%i%i%i%s",   p[0], p[1], 
 				    &fibsOptions[OptAllowPip], 
@@ -1824,21 +1829,21 @@
 			/*
 			 * need to get boards after new dice have arrived
 			 */
-			emit infoText("<font color=\"red\">toggle moreboards has been set</font>");
+			emit infoText("<font color=\"red\">" + i18n("The moreboards toggle has been \
set.") + "</font>");  emit serverString("toggle moreboards");
 		}
 		if (words >= 22 && n[8] != 1) {
 			/*
 			 * need to know who logs out
 			 */
-			emit infoText("<font color=\"red\">toggle notify has been set</font>");
+			emit infoText("<font color=\"red\">" + i18n("The notify toggle has been set.") + \
"</font>");  emit serverString("toggle notify");
 		}
 		if (words >= 22 && n[11] != 1) {
 			/*
 			 * want to know who starts playing games
 			 */
-			emit infoText("<font color=\"red\">toggle report has been set</font>");
+			emit infoText("<font color=\"red\">" + i18n("The report toggle has been set.") + \
"</font>");  emit serverString("toggle report");			
 		}
 		
@@ -1924,11 +1929,10 @@
 	 * at this point we are done creating the account
 	 */
 	if (line.contains(pat[RetypeP])) {
-		QString text = i18n("Your account has been created. Your new login is <u>")
-			+ infoFIBS[FIBSUser]
-			+ i18n("</u>. To fully activate this account, I will now close the "
-			       "connection. Once you reconnect, you can start playing "
-			       "backgammon on FIBS.");
+
+		QString text = i18n("Your account has been created. Your new login is <u>%1</u>. \
To fully activate " +				    "this account, I will now close the connection. Once you \
reconnect, you can start " +				    "playing backgammon on \
FIBS.").arg(infoFIBS[FIBSUser]);  emit infoText("<br/><hr/><font color=\"blue\">" + \
text + "</font><br/><hr/>");  emit serverString("bye");
 		rxStatus = RxNormal;
@@ -2040,7 +2044,7 @@
 		
 		emit changePlayerStatus(infoFIBS[FIBSUser], Away, true);
 		actBack->setEnabled(true);
-		line += i18n("<br/>&nbsp;&nbsp;(or use the corresponding menu entry to join the \
match)"); +		line += "<br/>&nbsp;&nbsp;" + i18n("(or use the corresponding menu entry \
to join the match)");  }
 	else if (line.contains(pat[YouBack])) {	      
 
@@ -2147,7 +2151,7 @@
 	else if (line.contains(pat[ConLeav])) {
 		actConti->setEnabled(true);
 		actLeave->setEnabled(true);
-		line.append(i18n("<br/>&nbsp;&nbsp;(or use the corresponding menu "
+		line.append("<br/>&nbsp;&nbsp;" + i18n("(or use the corresponding menu "
 				 "entry to leave or continue the match)"));
 	}
 	/*
@@ -2157,6 +2161,7 @@
 		rawline.replace(pat[WhoInfo], "");
 		if (rawline.contains(QRegExp("^" + infoFIBS[FIBSUser] + " "))) {
 			int ready;
+			// Using latin1() is fine, since the string is coming from FIBS.
 			sscanf(rawline.latin1(), "%*s %*s %*s %i %*s %*s %*s %*s %*s %*s %*s %*s", \
&ready);  fibsOpt[OptReady]->setChecked(ready);
 		}
@@ -2242,7 +2247,7 @@
 	else if (line.contains(pat[RejAcpt])) {
 		actAccept->setEnabled(true);
 		actReject->setEnabled(true);
-		line += i18n("<br/>&nbsp;&nbsp;(or use the corresponding menu "
+		line += "<br/>&nbsp;&nbsp;" + i18n("(or use the corresponding menu "
 			     "entry to accept or rejct the offer)");
 	}
 	/*
diff -urb kbackgammon.vanilla/kbginvite.cpp kbackgammon/kbginvite.cpp
--- kbackgammon.vanilla/kbginvite.cpp	Fri Feb  9 03:31:42 2001
+++ kbackgammon/kbginvite.cpp	Fri Feb  9 01:21:23 2001
@@ -158,7 +158,7 @@
 void KBgInvite::inviteClicked()
 {
 	QString tmp;
-	emit inviteCommand(QString("invite ") + le->text() + " " + \
tmp.setNum(sb->value())); +	emit inviteCommand("invite " + le->text() + " " + \
tmp.setNum(sb->value()));  }
 
 /*
@@ -166,7 +166,7 @@
  */
 void KBgInvite::unlimitedClicked()
 {
-	emit inviteCommand(QString("invite ") + le->text() + " unlimited");
+	emit inviteCommand("invite " + le->text() + " unlimited");
 }
 
 /*
@@ -174,7 +174,7 @@
  */
 void KBgInvite::resumeClicked()
 {
-	emit inviteCommand(QString("invite ") + le->text());
+	emit inviteCommand("invite " + le->text());
 }
 
 /*
diff -urb kbackgammon.vanilla/kbgoffline.cpp kbackgammon/kbgoffline.cpp
--- kbackgammon.vanilla/kbgoffline.cpp	Fri Feb  9 03:31:42 2001
+++ kbackgammon/kbgoffline.cpp	Fri Feb  9 02:33:07 2001
@@ -173,26 +173,20 @@
 	/*
 	 * Figure out who starts by rolling
 	 */
-	QString n, msg;
 	while (u == t) {
 		u = getRandom(); 
 		t = getRandom();
-		msg = nameUS + i18n(" rolls "); 
-		n.setNum(u); msg += n + ", " + nameTHEM + i18n(" rolls ");
-		n.setNum(t); msg += n + ".";
-		emit infoText(msg);
+		emit infoText(i18n("%1 rolls %2, %3 rolls \
%4.").arg(nameUS).arg(u).arg(nameTHEM).arg(t));  }
 
 	if (u > t) {
-		msg = nameUS;
+		emit infoText(i18n("%1 makes the first move.").arg(nameUS));
 		lastRoll = US;		
 	} else {		
-		msg = nameTHEM;
+		emit infoText(i18n("%1 makes the first move.").arg(nameTHEM));
 		lastRoll = THEM;		
 		int n = u; u = t; t = n;		
 	}
-	msg += i18n(" makes the first move.");
-	emit infoText(msg);
 
 	/*
 	 * set the dice and tell the board
@@ -202,7 +196,7 @@
 	/*
 	 * tell the user
 	 */
-	emit statText(nameUS + i18n(" vs. ") + nameTHEM);
+	emit statText(i18n("%1 vs. %2").arg(nameUS).arg(nameTHEM));
 }
 
 /*
@@ -248,17 +242,17 @@
 {
 	bool ret = false;
 	QString *name;
-	QString text = i18n("Please enter the nickname of the player whose "
-				 "home\nis in the ");
+	QString text;
 	
 	if (w == US) {
 		name = &nameUS;
-		text += i18n("lower ");
+		text = i18n("Please enter the nickname of the player whose home\n"
+			    "is in the lower half of the board.");
 	} else {
 		name = &nameTHEM;
-		text += i18n("upper ");
+		text = i18n("Please enter the nickname of the player whose home\n"
+			    "is in the upper half of the board.");
 	}
-	text += i18n("half of the board.");
 
 	do {
 		*name = KLineEditDlg::getText(text, *name, &ret, (QWidget *)parent());
@@ -285,9 +279,7 @@
 	
 	if (game->getHome(lastRoll) == 15) {
 
-		QString msg = (lastRoll == US) ? nameUS : nameTHEM;
-		msg += i18n(" wins the game. Congratulations!");
-		emit infoText(msg);
+		emit infoText(i18n("%1 wins the game. Congratulations!").arg((lastRoll == US) ? \
nameUS : nameTHEM));  gameRunning = false;
 		emit allowCommand(Roll, false);
 		emit allowCommand(Cube, false);
@@ -305,12 +297,7 @@
 
 			game[1] = game[0];
 
-			QString *s = new QString("");
-			*s += ((lastRoll == THEM) ? nameUS : nameTHEM);
-			*s += i18n(", please roll or double.");
-			emit infoText(*s);
-			delete s;
-
+			emit infoText(i18n("%1, please roll or double.").arg((lastRoll == THEM) ? nameUS \
: nameTHEM));  emit allowCommand(Cube, true);
 
 		} else {
@@ -490,33 +477,29 @@
 	/*
 	 * Tell the players how many checkers to move
 	 */
-	QString s = ((w == US) ? nameUS : nameTHEM);
-	QString t;
-	t.setNum(toMove);
 	switch (toMove) {
 	case -1:
-		s = i18n("Game over!");
+		emit infoText(i18n("Game over!"));
 		gameRunning = false;
 		emit allowCommand(Roll, false);
 		emit allowCommand(Cube, false);
 		emit allowMoving(false);
 		break;
 	case  0:
-		s += i18n(", you can't move.");
+		emit infoText(i18n("%1, you can't move.").arg((w == US) ? nameUS : nameTHEM));
 		if (commitTimeoutLength)
 			commitTimeout->start(commitTimeoutLength, true);
 		emit allowMoving(false);
 		break;
 	case  1:
-		s += i18n(", please move ") + t + i18n(" piece.");
+		emit infoText(i18n("%1, please move 1 piece.").arg((w == US) ? nameUS : \
nameTHEM));  emit allowMoving(true);
 		break;
 	default:
-		s += i18n(", please move ") + t + i18n(" pieces.");
+		emit infoText(i18n("%1, please move %2 pieces.").arg((w == US) ? nameUS : \
nameTHEM).arg(toMove));  emit allowMoving(true);
 		break;
 	}
-	emit infoText(s);
 }
 
 /*
@@ -691,31 +674,21 @@
 	int w = ((lastRoll == US) ? THEM : US);
 
 	if (rollingAllowed && game->getCube(w) > 0) {
-		
 		emit allowCommand(Cube, false);
-		
-		if (w ==   US) { cout << "US:   " << nameUS.latin1() << endl;}
-		if (w == THEM) { cout << "THEM: " << nameTHEM.latin1() << endl;}
-
-		QString msg = (w == THEM) ? nameTHEM : nameUS;
-		msg += i18n(" has doubled. ") + ((w == US) ? nameTHEM : nameUS);
-		msg += i18n(", do you accept the double?");
-		if (KMessageBox::questionYesNo((QWidget *)parent(), msg, i18n("Doubling"), 
-					       i18n("Accept"), i18n("Reject")) != KMessageBox::Yes) {
-			
+		if (KMessageBox::questionYesNo((QWidget *)parent(), 
+					       i18n("%1 has doubled. %2, do you accept the double?").
+					       arg((w == THEM) ? nameTHEM : nameUS).
+					       arg((w == US) ? nameTHEM : nameUS), 
+					       i18n("Doubling"), i18n("Accept"), i18n("Reject")) != KMessageBox::Yes) {
 			gameRunning = false;
 			emit allowCommand(Roll, false);
 			emit allowCommand(Cube, false);
-			msg = (w == US) ? nameUS : nameTHEM;
-			msg += i18n(" wins the game. Congratulations!");
-			emit infoText(msg);
+			emit infoText(i18n("%1 wins the game. Congratulations!").arg((w == US) ? nameUS : \
nameTHEM));  return;
 
 		}
 
-		msg = (w == THEM) ? nameUS : nameTHEM;
-		msg += i18n(" has accepted the double. The game continues");
-		emit infoText(msg);
+		emit infoText(i18n("%1 has accepted the double. The game continues").arg((w == \
THEM) ? nameUS : nameTHEM));  
 		if (game->getCube(US)*game->getCube(THEM) > 0)
 			game->setCube(2, w == THEM, w == US);
@@ -884,9 +857,7 @@
  */
 void  KBgEngineOffline::handleCommand(const QString& cmd)
 {
-	QString msg(i18n("Command \""));
-	msg += cmd + i18n("\" has been ignored.");
-	emit infoText(msg);
+	emit infoText(i18n("Text commands are not yet working. The command '%1' has been \
ignored.").arg(cmd));  }
 
 /*
@@ -955,11 +926,11 @@
 		emit allowCommand(Roll, false);
 		emit allowCommand(Done, false);
 		emit allowCommand(Cube, false);
-		emit statText(nameUS + i18n(" vs. ") + nameTHEM + i18n(" - Edit Mode"));
+		emit statText(i18n("%1 vs. %2 - Edit Mode").arg(nameUS).arg(nameTHEM));
 	} else {
 		newAction->setEnabled(true);
 		swapAction->setEnabled(true);
-		emit statText(nameUS + i18n(" vs. ") + nameTHEM);
+		emit statText(i18n("%1 vs. %2").arg(nameUS).arg(nameTHEM));
 		emit getState(game+1);
 		game[0] = game[1];
 		emit allowCommand(Done, donePossible);
diff -urb kbackgammon.vanilla/kfibschat.cpp kbackgammon/kfibschat.cpp
--- kbackgammon.vanilla/kfibschat.cpp	Fri Feb  9 03:31:43 2001
+++ kbackgammon/kfibschat.cpp	Fri Feb  9 03:23:42 2001
@@ -93,8 +93,7 @@
 					      "it is directed at you personally, shouted to the general "
 					      "FIBS population, has been said by you, or is of general "
 					      "interest. If you select the name of a player, the context "
-					      "contains entries specifically geared towards that player - "
-					      "I apologize for this rather strange behaviour."));
+					 "contains entries specifically geared towards that player."));
 	/*
 	 * Fully initialize the context menu
 	 */
@@ -204,7 +203,7 @@
 {
 	if (gagList.contains(currUser.latin1()) <= 0)		//lukas: FIXME
 		gagList.append(currUser.latin1());
-	textWindow->write(QString("<font color=\"blue\">") + i18n("You won't hear what %1 \
says and shouts.").arg(currUser) + "</font>"); +	textWindow->write("<font \
color=\"blue\">" + i18n("You won't hear what %1 says and shouts.").arg(currUser) + \
"</font>");  }
 
 /* 
@@ -238,9 +237,7 @@
 void KFibsChat::clearGagList()
 {
 	gagList.clear();
-	textWindow->write(QString("<font color=\"blue\">") 
-			  + i18n("Gag list is now empty.") 
-			  + "</font>");
+	textWindow->write("<font color=\"blue\">"  + i18n("Gag list is now empty.") + \
"</font>");  }
 
 /*
@@ -249,13 +246,9 @@
 void KFibsChat::toggleSilent()
 {
 	if (silent = !silent) 
-		textWindow->write(QString("<font color=\"blue\">") 
-				  + i18n("You won't hear what people shout.") 
-				  + "</font>");
+		textWindow->write("<font color=\"blue\">" + i18n("You won't hear what people \
shout.") + "</font>");  else
-		textWindow->write(QString("<font color=\"blue\">") 
-				  + i18n("You will hear what people shout.") 
-				  + "</font>");
+		textWindow->write("<font color=\"blue\">" + i18n("You will hear what people \
shout.") + "</font>");  }
 
 // == various slots and functions ==============================================
@@ -356,7 +349,7 @@
 		gagList = gl->getGagList();
 		for (uint i = 0; i < tmp.count(); i++) {
 			if (!gagList.contains(tmp.at(i))) {
-				textWindow->write(QString("<font color=\"blue\">") 
+				textWindow->write("<font color=\"blue\">"
 						  + i18n("You will hear what %1 says and shouts.").arg(tmp.at(i))
 						  + "</font>");
 			}
@@ -429,10 +422,9 @@
 
 		switch (cmd) {			
 		case CLIP_SAYS:
-			if (!gagList.contains(user.latin1())) {	//lukas: FIXME, all the case's
-				cMsg.replace(cMsg.find(' '), 1, i18n(" tells you:</u> "));
-				cMsg = "<u>" + cMsg;
-				cMsg = QString("<font color=\"red\">") + cMsg + "</font>";
+			if (!gagList.contains(user.latin1())) {
+				cMsg = i18n("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + \
user), "")); +				cMsg = "<font color=\"red\">" + cMsg + "</font>";
 				emit personalMessage(cMsg);
 			} else 
 				cMsg = "";
@@ -440,17 +432,16 @@
 
 		case CLIP_SHOUTS:
 			if ((!silent) && (!gagList.contains(user.latin1()))) {
-				cMsg.replace(cMsg.find(' '), 1, i18n(" shouts:</u> "));
-				cMsg = QString("<font color=\"black\">") + "<u>" + cMsg + "</font>";
+				cMsg = i18n("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + \
user), "")); +				cMsg = "<font color=\"black\">" + cMsg + "</font>";
 			} else
 				cMsg = "";
 			break;
 			
 		case CLIP_WHISPERS:
 			if (!gagList.contains(user.latin1())) {
-				cMsg.replace(cMsg.find(' '), 1, i18n(" whispers:</u> "));
-				cMsg = "<u>" + cMsg;
-				cMsg = QString("<font color=\"red\">") + cMsg + "</font>";
+				cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + \
user), "")); +				cMsg = "<font color=\"red\">" + cMsg + "</font>";
 				emit personalMessage(cMsg);
 			} else 
 				cMsg = "";
@@ -458,36 +449,34 @@
 
 		case CLIP_KIBITZES:
 			if (!gagList.contains(user.latin1())) {
-				cMsg.replace(cMsg.find(' '), 1, i18n(" kibitzes:</u> "));
-				cMsg = "<u>" + cMsg;
-				cMsg = QString("<font color=\"red\">") + cMsg + "</font>";
+				cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + \
user), "")); +				cMsg = "<font color=\"red\">" + cMsg + "</font>";
 				emit personalMessage(cMsg);
 			} else 
 				cMsg = "";
 			break;
 
 		case CLIP_YOU_SAY:
-			cMsg.replace(cMsg.find(' '), 1, ":</u> ");
-			cMsg = i18n("<u>You tell ") + cMsg;
-			cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>";
+			cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(QRegExp("^" + \
user), "")); +			cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
 			emit personalMessage(cMsg);
 			break;
 
 		case CLIP_YOU_SHOUT:
-			cMsg = i18n("<u>You shout:</u> ") + cMsg;
-			cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>";
+			cMsg = i18n("<u>You shout:</u> %1").arg(cMsg);
+			cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
 			emit personalMessage(cMsg);
 			break;
 
 		case CLIP_YOU_WHISPER:
-			cMsg = i18n("<u>You whisper:</u> ") + cMsg;
-			cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>";
+			cMsg = i18n("<u>You whisper:</u> %1").arg(cMsg);
+			cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
 			emit personalMessage(cMsg);
 			break;
 
 		case CLIP_YOU_KIBITZ:
-			cMsg = i18n("<u>You kibitz:</u> ") + cMsg;
-			cMsg = QString("<font color=\"darkgreen\">") + cMsg + "</font>";
+			cMsg = i18n("<u>You kibitz:</u> %1").arg(cMsg);
+			cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
 			emit personalMessage(cMsg);
 			break;
 
@@ -496,10 +485,8 @@
 			cMsg.remove(0, cMsg.find(' ')+1);
 			date.setTime_t(cMsg.left(cMsg.find(' ')+1).toUInt());
 			cMsg.remove(0, cMsg.find(' '));
-			cMsg = QString("<font color=\"red\"><u>") 
-               + i18n("user left message at date"
-                   , "%1 left a message at %2:").arg(user).arg(date.toString())
-               + "</u> " + "<i>" + cMsg + "</i></font>";
+			cMsg = i18n("<u>User %1 left a message at %2</u>: \
%3").arg(user).arg(date.toString()).arg(cMsg); +			cMsg = "<font color=\"red\">" + \
cMsg + "</font>";  emit personalMessage(cMsg);
 			break;
 
@@ -517,14 +504,12 @@
 			
 		default: // ignore the message
 			return;
-
 		}
 
 	} else {
 		// dump the string to cerr
 		cerr << "KFibsChat::handleData unhandled message: " << cMsg.latin1() << endl;
 		return;
-
 	}
 
 	if (cMsg != "")
diff -urb kbackgammon.vanilla/kplayerlist.cpp kbackgammon/kplayerlist.cpp
--- kbackgammon.vanilla/kplayerlist.cpp	Fri Feb  9 03:31:43 2001
+++ kbackgammon/kplayerlist.cpp	Fri Feb  9 02:39:56 2001
@@ -60,17 +60,17 @@
  */
 QString KFibsPlayerList::columnTitle[LVEnd] = {
 	
-	I18N_NOOP("Player"),
-	I18N_NOOP("Opponent"),
-	I18N_NOOP("Watching"),
-	I18N_NOOP("Status"),
-	I18N_NOOP("Rating"),
-	I18N_NOOP("Exp."),
-	I18N_NOOP("Idle"),
-	I18N_NOOP("Time"),
-	I18N_NOOP("Hostname"),
-	I18N_NOOP("Client"),
-	I18N_NOOP("Email")
+	i18n("Player"),
+	i18n("Opponent"),
+	i18n("Watching"),
+	i18n("Status"),
+	i18n("Rating"),
+	i18n("Exp."),
+	i18n("Idle"),
+	i18n("Time"),
+	i18n("Hostname"),
+	i18n("Client"),
+	i18n("Email")
 };
 
 /*
@@ -188,9 +188,7 @@
  */
 void KFibsPlayerList::updateCaption()
 {
-	QString s;
-	s.sprintf("%s - %d - %d/%d", "Player List", childCount(), cCount[0], cCount[1]);
-	setCaption(s);
+	setCaption(i18n("%1 - %2 - %3/%4").arg("Player \
List").arg(childCount()).arg(cCount[0]).arg(cCount[1]));  }
 
 /*
@@ -232,7 +230,6 @@
 		column[i]->show  = config->readBoolEntry("col-" + columnKey[i], true);
 		column[i]->width =  config->readNumEntry("col-w-" + columnKey[i], -1);
 	}
-
 }
 
 /*
@@ -299,7 +296,7 @@
 	gl->activate();
 	w->adjustSize();
 	w->setMinimumSize(w->size());
-	nb->addTab(w, "&Player List");
+	nb->addTab(w, i18n("&Player List"));
 
 	connect(nb, SIGNAL(applyButtonPressed()), this, SLOT(setupOk()));
 }
@@ -366,6 +363,7 @@
 	QString tmp;
 	int j;
 
+	// the line comes from FIBS and is 7 bit ASCII
 	sscanf(line.latin1(), "%s %s %s %s %s %s %s %s %s %s %s %s", entry[Player], \
                entry[Opponent], 
 	       entry[Watches], ready, away, entry[Rating], entry[Experience], entry[Idle], \
entry[Time],   entry[Host], entry[Client], entry[Email]);
@@ -457,17 +455,6 @@
 	 */
 	QListViewItemIterator it(this);
 	for ( ; it.current(); ++it) {
-		
-		/*
-		 * hi lukas. thanks for the code review. regarding the i18n/I18N_NOOP issue:
-		 * that was mostly "I have seen both and i18n was first, I18N_NOOP came later.
-		 * So if you could please enlighten me which one is prefereable, I would be
-		 * more than happy to do follow that avise in the future. 
-		 *
-		 * You could also drop me an email to jens@hoefkens.com...
-		 *
-		 * Ciao, Jens
-		 */
 		if (strcmp(it.current()->text(Player).latin1(), player.latin1()) == 0) {		//lukas: \
FIXME  i = it.current();
 			goto found;


 
> > Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic