[rkward/frameworks] /: Conver now-invalid usages of i18n("...%1...").arg(x) to i18n("...%1...", x)

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Nov 26 09:50:55 UTC 2015


Git commit eeb33b530e5bff350975e3da4e00d3f810d2da50 by Thomas Friedrichsmeier.
Committed on 26/11/2015 at 08:53.
Pushed by tfry into branch 'frameworks'.

Conver now-invalid usages of i18n("...%1...").arg(x) to i18n("...%1...",x)

M  +0    -1    TODO
M  +4    -3    rkward/plugin/rkcomponentmap.cpp
M  +3    -3    rkward/rbackend/rkfrontendtransmitter.cpp
M  +3    -3    rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
M  +1    -1    rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
M  +1    -1    rkward/windows/rkhelpsearchwindow.cpp

http://commits.kde.org/rkward/eeb33b530e5bff350975e3da4e00d3f810d2da50

diff --git a/TODO b/TODO
index 4591555..ee92f3a 100644
--- a/TODO
+++ b/TODO
@@ -6,7 +6,6 @@ KF5 port:
 Things to do:
 - Remove kde4libssupport classes
 - Adjust platform checks
-- Check for usages of i18n ("%1").arg(x), instead of i18n ("%1", x)
 - Device window embedding / remove qwinhost
 Things to test at the end:
 - Everthing concerning loading / saving, from recent files, scripts, workspace, etc.
diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index 22e678b..09160bc 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -36,6 +36,7 @@
 #include "../rkward.h"
 #include "../settings/rksettingsmoduleplugins.h"
 #include "../rbackend/rksessionvars.h"
+#include "../dialogs/rkerrordialog.h"
 
 QString RKPluginMapFile::makeFileName (const QString &filename) const {
 	return QDir::cleanPath (QDir (basedir).filePath (filename));
@@ -468,7 +469,7 @@ bool RKComponentMap::invokeComponent (const QString &component_id, const QString
 	QString _message;
 	RKComponentHandle *handle = getComponentHandle (component_id);
 	if (!handle) {
-		_message = i18n ("You tried to invoke a plugin called '%1', but that plugin is currently unknown. Probably you need to load the corresponding PluginMap (Settings->Configure RKWard->Plugins), or perhaps the plugin was renamed.").arg (component_id);
+		_message = i18n ("You tried to invoke a plugin called '%1', but that plugin is currently unknown. Probably you need to load the corresponding PluginMap (Settings->Configure RKWard->Plugins), or perhaps the plugin was renamed.", component_id);
 		if (message) *message = _message;
 		else KMessageBox::sorry (RKWardMainWindow::getMain (), _message, i18n ("No such plugin"));
 		return false;
@@ -480,9 +481,9 @@ bool RKComponentMap::invokeComponent (const QString &component_id, const QString
 	RKComponent::PropertyValueMap state;
 	bool format_ok = RKComponent::stringListToValueMap (serialized_settings, &state);
 	if (!format_ok) {
-		_message = i18n ("Bad serialization format while trying to invoke plugin '%1'. Please contact the RKWard team (Help->About RKWard->Authors).").arg (component_id);
+		_message = i18n ("Bad serialization format while trying to invoke plugin '%1'. In general, this should not happen, unless you modified the parameters by hand. Please consider reporting this issue.", component_id);
 		if (message) *message = _message;
-		else KMessageBox::error (component, _message, i18n ("Bad serialization format"));
+		else RKErrorDialog::reportableErrorMessage (component, _message, QString (), i18n ("Bad serialization format"), "invoke_comp_deserialization_error");
 		return false;
 	}
 	component->applyState (state);
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index c632ef7..346d636 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -108,7 +108,7 @@ void RKFrontendTransmitter::run () {
 	}
 
 	if (!backend->waitForStarted ()) {
-		handleTransmissionError (i18n ("The backend executable could not be started. Error message was: %1").arg (backend->errorString ()));
+		handleTransmissionError (i18n ("The backend executable could not be started. Error message was: %1", backend->errorString ()));
 	}
 
 	// fetch security token
@@ -136,11 +136,11 @@ void RKFrontendTransmitter::connectAndEnterLoop () {
 	if (!con->canReadLine ()) con->waitForReadyRead (1000);
 	QString token_c = QString::fromLocal8Bit (con->readLine ());
 	token_c.chop (1);
-	if (token_c != token) handleTransmissionError (i18n ("Error during handshake with backend process. Expected token '%1', received token '%2'").arg (token).arg (token_c));
+	if (token_c != token) handleTransmissionError (i18n ("Error during handshake with backend process. Expected token '%1', received token '%2'", token, token_c));
 	if (!con->canReadLine ()) con->waitForReadyRead (1000);
 	QString version_c = QString::fromLocal8Bit (con->readLine ());
 	version_c.chop (1);
-	if (version_c != RKWARD_VERSION) handleTransmissionError (i18n ("Version mismatch during handshake with backend process. Frontend is version '%1' while backend is '%2'.\nPlease fix your installation.").arg (RKWARD_VERSION).arg (version_c));
+	if (version_c != RKWARD_VERSION) handleTransmissionError (i18n ("Version mismatch during handshake with backend process. Frontend is version '%1' while backend is '%2'.\nPlease fix your installation.", QString (RKWARD_VERSION), version_c));
 
 	setConnection (con);
 }
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
index d7fb5c7..253b083 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
@@ -108,7 +108,7 @@ RKGraphicsDevice* RKGraphicsDevice::newDevice (int devnum, double width, double
 		RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Graphics device number %d already exists while trying to create it", devnum);
 		closeDevice (devnum);
 	}
-	RKGraphicsDevice* dev = new RKGraphicsDevice (width, height, title.isEmpty () ? i18n ("Graphics Device Number %1").arg (QString::number (devnum+1)) : title, antialias);
+	RKGraphicsDevice* dev = new RKGraphicsDevice (width, height, title.isEmpty () ? i18n ("Graphics Device Number %1", QString::number (devnum+1)) : title, antialias);
 	devices.insert (devnum, dev);
 	return (dev);
 }
@@ -274,8 +274,8 @@ QImage RKGraphicsDevice::capture () const {
 void RKGraphicsDevice::setActive (bool active) {
 	RK_TRACE (GRAPHICS_DEVICE);
 
-	if (active) view->setWindowTitle (i18n ("%1 (Active)").arg (base_title));
-	else view->setWindowTitle (i18n ("%1 (Inactive)").arg (base_title));
+	if (active) view->setWindowTitle (i18nc ("Window title", "%1 (Active)", base_title));
+	else view->setWindowTitle (i18nc ("Window title", "%1 (Inactive)", base_title));
 	emit (activeChanged (active));
 	emit (captionChanged (view->windowTitle ()));
 }
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
index 47b070d..4a3b9ba 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
@@ -74,7 +74,7 @@ void RKGraphicsDeviceFrontendTransmitter::newConnection () {
 	QString token_c = QString::fromLocal8Bit (con->readLine ());
 	token_c.chop (1);
 	if (token_c != token) {
-		KMessageBox::detailedError (0, QString ("<p>%1</p>").arg (i18n ("There has been an error while trying to connect the on-screen graphics backend. This means, on-screen graphics using the RKWard device will not work in this session.")), i18n ("Expected connection token %1, but read connection token %2").arg (token).arg (token_c), i18n ("Error while connection graphics backend"));
+		KMessageBox::detailedError (0, QString ("<p>%1</p>").arg (i18n ("There has been an error while trying to connect the on-screen graphics backend. This means, on-screen graphics using the RKWard device will not work in this session.")), i18n ("Expected connection token %1, but read connection token %2", token, token_c), i18n ("Error while connection graphics backend"));
 		con->close ();
 		return;
 	}
diff --git a/rkward/windows/rkhelpsearchwindow.cpp b/rkward/windows/rkhelpsearchwindow.cpp
index 84151ae..c365ea4 100644
--- a/rkward/windows/rkhelpsearchwindow.cpp
+++ b/rkward/windows/rkhelpsearchwindow.cpp
@@ -168,7 +168,7 @@ void RKHelpSearchWindow::getFunctionHelp (const QString &function_name, const QS
 	command.append (")");
 	if (type == "vignette") command.append (")");
 
-	RKGlobals::rInterface ()->issueCommand (command, RCommand::App | RCommand::GetStringVector, i18n ("Find HTML help for %1").arg (function_name), this, GET_HELP);
+	RKGlobals::rInterface ()->issueCommand (command, RCommand::App | RCommand::GetStringVector, i18n ("Find HTML help for %1", function_name), this, GET_HELP);
 }
 
 void RKHelpSearchWindow::slotFindButtonClicked () {



More information about the rkward-tracker mailing list