← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n] Rev 401: Some more translations

 

------------------------------------------------------------
revno: 401
committer: Steven Sheehy <steven.sheehy@xxxxxxxxx>
branch nick: linuxdcpp-i18n
timestamp: Wed 2010-11-10 01:07:40 -0600
message:
  Some more translations
modified:
  linux/IntlUtil.hh
  linux/downloadqueue.cc
  linux/favoriteusers.cc
  linux/finishedtransfers.cc
  linux/hashdialog.cc
  linux/hub.cc
  linux/hub.hh


--
lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n
https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n

Your team LinuxDC++ Team is subscribed to branch lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n.
To unsubscribe from this branch go to https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n/+edit-subscription
=== modified file 'linux/IntlUtil.hh'
--- linux/IntlUtil.hh	2010-11-10 03:45:41 +0000
+++ linux/IntlUtil.hh	2010-11-10 07:07:40 +0000
@@ -40,6 +40,7 @@
 
 #define F_(text, params) (message_format(_(text)) params).str()
 #define P_(text, text_plural, params, n) (message_format(g_dngettext(NULL, text, text_plural, n)) params).str()
+#define FC_(context, text, params) (message_format(C_(context, text)) params).str()
 
 #endif /* LINUXDCPP_INTL_UTIL_HH */
 

=== modified file 'linux/downloadqueue.cc'
--- linux/downloadqueue.cc	2010-11-10 03:45:41 +0000
+++ linux/downloadqueue.cc	2010-11-10 07:07:40 +0000
@@ -1292,27 +1292,25 @@
 	}
 
 	// Priority
-	/* TRANSLATORS: Please make sure that the priorities
-	   are consistent with the ones in the glade files. */
 	switch (item->getPriority())
 	{
 		case QueueItem::PAUSED:
-			params["Priority"] = _("Paused");
+			params["Priority"] = C_("Priority", "Paused");
 			break;
 		case QueueItem::LOWEST:
-			params["Priority"] = _("Lowest");
+			params["Priority"] = C_("Priority", "Lowest");
 			break;
 		case QueueItem::LOW:
-			params["Priority"] = _("Low");
+			params["Priority"] = C_("Priority", "Low");
 			break;
 		case QueueItem::HIGH:
-			params["Priority"] = _("High");
+			params["Priority"] = C_("Priority", "High");
 			break;
 		case QueueItem::HIGHEST:
-			params["Priority"] = _("Highest");
+			params["Priority"] = C_("Priority", "Highest");
 			break;
 		default:
-			params["Priority"] = _("Normal");
+			params["Priority"] = C_("Priority", "Normal");
 	}
 
 	// Error

=== modified file 'linux/favoriteusers.cc'
--- linux/favoriteusers.cc	2010-10-22 04:05:48 +0000
+++ linux/favoriteusers.cc	2010-11-10 07:07:40 +0000
@@ -96,7 +96,7 @@
 		const FavoriteUser &user = it->second;
 		bool online = user.getUser()->isOnline();
 		string hub = online ? WulforUtil::getHubNames(user.getUser()) : user.getUrl();
-		string seen = online ? _("Online") : Util::formatTime("%Y-%m-%d %H:%M", user.getLastSeen());
+		string seen = online ? C_("User", "Online") : Util::formatTime("%Y-%m-%d %H:%M", user.getLastSeen());
 		string cid = user.getUser()->getCID().toBase32();
 
 		gtk_list_store_append(favoriteUserStore, &iter);
@@ -609,7 +609,7 @@
 	bool online = user.getUser()->isOnline();
 	params.insert(ParamMap::value_type("User", user.getNick()));
 	params.insert(ParamMap::value_type("Hub", online ? WulforUtil::getHubNames(user.getUser()) : user.getUrl()));
-	params.insert(ParamMap::value_type("Time", online ? _("Online") : Util::formatTime("%Y-%m-%d %H:%M", user.getLastSeen())));
+	params.insert(ParamMap::value_type("Time", online ? C_("User", "Online") : Util::formatTime("%Y-%m-%d %H:%M", user.getLastSeen())));
 	params.insert(ParamMap::value_type("Description", user.getDescription()));
 	params.insert(ParamMap::value_type("CID", user.getUser()->getCID().toBase32()));
 	params.insert(ParamMap::value_type("URL", user.getUrl()));
@@ -634,7 +634,7 @@
 
 	if (user->isOnline())
 	{
-		seen = _("Online");
+		seen = C_("User", "Online");
 	}
 	else
 	{

=== modified file 'linux/finishedtransfers.cc'
--- linux/finishedtransfers.cc	2010-10-22 04:05:48 +0000
+++ linux/finishedtransfers.cc	2010-11-10 07:07:40 +0000
@@ -156,7 +156,7 @@
 
 void FinishedTransfers::updateStatus_gui()
 {
-	string status = Util::toString(totalFiles) + _(" files");
+	string status = P_("%1% file", "%1% files", % totalFiles, totalFiles);
 
 	string size = Util::formatBytes(totalBytes);
 	string speed = Util::formatBytes((totalTime > 0) ? totalBytes * ((int64_t)1000) / totalTime : 0) + "/s";

=== modified file 'linux/hashdialog.cc'
--- linux/hashdialog.cc	2009-03-12 05:47:55 +0000
+++ linux/hashdialog.cc	2010-11-10 07:07:40 +0000
@@ -55,25 +55,29 @@
 	double diff = tick - startTime;
 	if (diff < 1000 || files == 0 || bytes == 0)
 	{
-		gtk_label_set_text(GTK_LABEL(getWidget("labelSpeed")), string("-.-- B/s, " + Util::formatBytes(bytes) + _(" left")).c_str());
-		gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), _("-:--:-- left"));
-		gtk_progress_bar_set_text (GTK_PROGRESS_BAR(getWidget("progressbar")), "0%");
+		// TRANSLATORS: Hashing speed and bytes left
+		const gchar *speed = F_("%1%/s, %2% left", % Util::formatBytes(0) % Util::formatBytes(bytes)).c_str();
+		gtk_label_set_text(GTK_LABEL(getWidget("labelSpeed")), speed);
+		gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), C_("Time", "-:--:-- left"));
+		gtk_progress_bar_set_text(GTK_PROGRESS_BAR(getWidget("progressbar")), "0%");
 		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(getWidget("progressbar")), 0.0);
 	}
 	else
 	{
 		double speedStat = (((double)(startBytes - bytes)) * 1000) / diff;
+		const gchar *speed = F_("%1%/s, %2% left", % Util::formatBytes((int64_t)speedStat) % Util::formatBytes(bytes)).c_str();
 
-		gtk_label_set_text(GTK_LABEL(getWidget("labelSpeed")), string(Util::formatBytes((int64_t)speedStat) + "/s, " + Util::formatBytes(bytes) + " left").c_str());
+		gtk_label_set_text(GTK_LABEL(getWidget("labelSpeed")), speed);
 
 		if (speedStat == 0)
 		{
-			gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), _("-:--:-- left"));
+			gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), C_("Time", "-:--:-- left"));
 		}
 		else
 		{
 			double ss = (double)bytes / speedStat;
-			gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), string(Util::formatSeconds((int64_t)ss) + _(" left")).c_str());
+			const gchar *time = FC_("Time", "%1% left", % Util::formatSeconds((int64_t)ss)).c_str();
+			gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), time);
 		}
 	}
 

=== modified file 'linux/hub.cc'
--- linux/hub.cc	2010-10-22 04:05:48 +0000
+++ linux/hub.cc	2010-11-10 07:07:40 +0000
@@ -201,6 +201,12 @@
 	return FALSE;
 }
 
+void Hub::updateStats_gui()
+{
+	setStatus_gui("statusUsers", P_("%1% User", "%1% Users", % userMap.size(), userMap.size()));
+	setStatus_gui("statusShared", Util::formatBytes(totalShared));
+}
+
 void Hub::updateUser_gui(ParamMap params, bool showJoin)
 {
 	GtkTreeIter iter;
@@ -211,7 +217,7 @@
 	if (findUser_gui(cid, &iter))
 	{
 		totalShared += shared - nickView.getValue<int64_t>(&iter, "Shared");
-		string nick = nickView.getString(&iter,"User");
+		string nick = nickView.getString(&iter, "User");
 
 		if (nick != params["User"])
 		{
@@ -255,11 +261,10 @@
 		userIters[cid] = iter;
 
 		if (showJoin)
-			addStatusMessage_gui(params["User"] + _(" has joined"));
+			addStatusMessage_gui(F_("%1% has joined", % params["User"]));
 	}
 
-	setStatus_gui("statusUsers", Util::toString(userMap.size()) + _(" Users"));
-	setStatus_gui("statusShared", Util::formatBytes(totalShared));
+	updateStats_gui();
 }
 
 void Hub::removeUser_gui(string cid)
@@ -275,8 +280,7 @@
 		removeTag_gui(nick);
 		userMap.erase(nick);
 		userIters.erase(cid);
-		setStatus_gui("statusUsers", Util::toString(userMap.size()) + _(" Users"));
-		setStatus_gui("statusShared", Util::formatBytes(totalShared));
+		updateStats_gui();
 	}
 }
 
@@ -302,8 +306,7 @@
 	userMap.clear();
 	userIters.clear();
 	totalShared = 0;
-	setStatus_gui("statusUsers", _("0 Users"));
-	setStatus_gui("statusShared", "0 B");
+	updateStats_gui();
 }
 
 void Hub::popupNickMenu_gui()
@@ -894,7 +897,7 @@
 				Util::setAway(TRUE);
 				Util::setManualAway(TRUE);
 				Util::setAwayMessage(param);
-				hub->addStatusMessage_gui(_("Away mode on: ") + Util::getAwayMessage());
+				hub->addStatusMessage_gui(F_("Away mode on: %1%", % Util::getAwayMessage()));
 			}
 		}
 		else if (command == _("back"))
@@ -991,7 +994,7 @@
 		}
 		else
 		{
-			hub->addStatusMessage_gui(_("Unknown command '") + text + _("': type /help for a list of available commands"));
+			hub->addStatusMessage_gui(F_("Unknown command '%1%': type /help for a list of available commands", % text));
 		}
 
 	}
@@ -1222,7 +1225,7 @@
 			if (gtk_tree_model_get_iter(GTK_TREE_MODEL(hub->nickStore), &iter, path))
 			{
 				cid = hub->nickView.getString(&iter, "CID");
-				nick = hub->nickView.getString(&iter, _("User"));
+				nick = hub->nickView.getString(&iter, "User");
 				if (!cid.empty() && nick != hub->client->getMyNick())
 				{
 					F1 *func = new F1(hub, &Hub::addFavoriteUser_client, cid);
@@ -1349,7 +1352,7 @@
 		if (user)
 		{
 			UploadManager::getInstance()->reserveSlot(user, client->getHubUrl());
-			message = _("Slot granted to ") + WulforUtil::getNicks(user);
+			message = F_("Slot granted to %1%", % WulforUtil::getNicks(user));
 		}
 	}
 
@@ -1486,7 +1489,7 @@
 void Hub::on(ClientListener::Connecting, Client *) throw()
 {
 	typedef Func1<Hub, string> F1;
-	F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, _("Connecting to ") + client->getHubUrl());
+	F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, F_("Connecting to %1%", % client->getHubUrl()));
 	WulforManager::get()->dispatchGuiFunc(f1);
 }
 
@@ -1541,7 +1544,7 @@
 
 	if (showJoins_client(user.getUser()))
 	{
-		func = new F1(this, &Hub::addStatusMessage_gui, nick + _(" has quit"));
+		func = new F1(this, &Hub::addStatusMessage_gui, F_("%1% has quit", % nick));
 		WulforManager::get()->dispatchGuiFunc(func);
 	}
 
@@ -1563,7 +1566,7 @@
 	WulforManager::get()->dispatchGuiFunc(f0);
 
 	typedef Func1<Hub, string> F1;
-	F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, _("Connect failed: ") + reason);
+	F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, F_("Connect failed: ", % reason));
 	WulforManager::get()->dispatchGuiFunc(f1);
 }
 
@@ -1698,7 +1701,7 @@
 	}
 	else if (user.getIdentity().isBot() && BOOLSETTING(IGNORE_BOT_PMS))
 	{
-		error = _("Ignored private message from bot ") + user.getIdentity().getNick();
+		error = F_("Ignored private message from bot %1%", % user.getIdentity().getNick());
 		typedef Func1<Hub, string> F1;
 		F1 *func = new F1(this, &Hub::addStatusMessage_gui, error);
 		WulforManager::get()->dispatchGuiFunc(func);
@@ -1722,7 +1725,7 @@
 void Hub::on(ClientListener::SearchFlood, Client *, const string &msg) throw()
 {
 	typedef Func1<Hub, string> F1;
-	F1 *func = new F1(this, &Hub::addStatusMessage_gui, _("Search spam detected from ") + msg);
+	F1 *func = new F1(this, &Hub::addStatusMessage_gui, F_("Search spam detected from %1%", % msg));
 	WulforManager::get()->dispatchGuiFunc(func);
 }
 

=== modified file 'linux/hub.hh'
--- linux/hub.hh	2010-10-11 06:05:22 +0000
+++ linux/hub.hh	2010-11-10 07:07:40 +0000
@@ -50,6 +50,7 @@
 		void setStatus_gui(std::string statusBar, std::string text);
 		bool findUser_gui(const std::string &cid, GtkTreeIter *iter);
 		bool findNick_gui(const std::string &nick, GtkTreeIter *iter);
+		void updateStats_gui();
 		void updateUser_gui(ParamMap id, bool showJoin);
 		void removeUser_gui(std::string cid);
 		void removeTag_gui(const std::string &nick);