Commit 3e01e573 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

translatability improvements

parent a799be53
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
** **
**************************************************************************/ **************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "gdbengine.h" #include "gdbengine.h"
#include "gdboptionspage.h" #include "gdboptionspage.h"
...@@ -471,8 +473,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -471,8 +473,7 @@ void GdbEngine::handleResponse(const QByteArray &buff)
QByteArray data = GdbMi::parseCString(from, to); QByteArray data = GdbMi::parseCString(from, to);
m_pendingConsoleStreamOutput += data; m_pendingConsoleStreamOutput += data;
if (data.startsWith("Reading symbols from ")) { if (data.startsWith("Reading symbols from ")) {
q->showStatusMessage(tr("Reading ") q->showStatusMessage(tr("Reading %1...").arg(_(data.mid(21))));
+ _(data.mid(21)));
} }
break; break;
} }
...@@ -1188,16 +1189,13 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) ...@@ -1188,16 +1189,13 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
qq->notifyInferiorExited(); qq->notifyInferiorExited();
QString msg; QString msg;
if (reason == "exited") { if (reason == "exited") {
msg = "Program exited with exit code " msg = tr("Program exited with exit code %1")
+ _(data.findChild("exit-code").toString()); .arg(_(data.findChild("exit-code").toString()));
} else if (reason == "exited-signalled") { } else if (reason == "exited-signalled" || reason == "signal-received") {
msg = "Program exited after receiving signal " msg = tr("Program exited after receiving signal %1")
+ _(data.findChild("signal-name").toString()); .arg(_(data.findChild("signal-name").toString()));
} else if (reason == "signal-received") {
msg = "Program exited after receiving signal "
+ _(data.findChild("signal-name").toString());
} else { } else {
msg = "Program exited normally"; msg = tr("Program exited normally");
} }
q->showStatusMessage(msg); q->showStatusMessage(msg);
sendCommand(_("-gdb-exit"), GdbExit); sendCommand(_("-gdb-exit"), GdbExit);
...@@ -2565,7 +2563,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record) ...@@ -2565,7 +2563,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record)
module.moduleName = QString::fromLocal8Bit(item.findChild("path").data()); module.moduleName = QString::fromLocal8Bit(item.findChild("path").data());
module.symbolsRead = (item.findChild("state").data() == "Y"); module.symbolsRead = (item.findChild("state").data() == "Y");
module.startAddress = _(item.findChild("loaded_addr").data()); module.startAddress = _(item.findChild("loaded_addr").data());
module.endAddress = _("<unknown>"); //: End address of loaded module
module.endAddress = tr("<unknown>");
modules.append(module); modules.append(module);
} }
} }
...@@ -2932,7 +2931,9 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0) ...@@ -2932,7 +2931,9 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
static const QString strNotInScope = _("<not in scope>"); //: Variable
static const QString strNotInScope =
QApplication::translate("Debugger::Internal::GdbEngine", "<not in scope>");
static void setWatchDataValue(WatchData &data, const GdbMi &mi, static void setWatchDataValue(WatchData &data, const GdbMi &mi,
int encoding = 0) int encoding = 0)
...@@ -3615,6 +3616,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record, ...@@ -3615,6 +3616,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
//qDebug() << "RECEIVED" << record.toString() << " FOR " << data0.toString() //qDebug() << "RECEIVED" << record.toString() << " FOR " << data0.toString()
// << " STREAM: " << out; // << " STREAM: " << out;
if (list.isEmpty()) { if (list.isEmpty()) {
//: Value for variable
data.setValue(tr("<unavailable>")); data.setValue(tr("<unavailable>"));
data.setAllUnneeded(); data.setAllUnneeded();
insertData(data); insertData(data);
...@@ -3629,6 +3631,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record, ...@@ -3629,6 +3631,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
insertData(data); insertData(data);
} else if (data.type == __("QStringList") || data.type.endsWith(__("::QStringList"))) { } else if (data.type == __("QStringList") || data.type.endsWith(__("::QStringList"))) {
int l = list.size(); int l = list.size();
//: In string list
data.setValue(tr("<%1 items>").arg(l)); data.setValue(tr("<%1 items>").arg(l));
data.setChildCount(list.size()); data.setChildCount(list.size());
data.setAllUnneeded(); data.setAllUnneeded();
...@@ -3648,6 +3651,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record, ...@@ -3648,6 +3651,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
sendSynchronizedCommand(cmd, WatchDebuggingHelperValue3, var); sendSynchronizedCommand(cmd, WatchDebuggingHelperValue3, var);
} }
} else { } else {
//: Value for variable
data.setValue(tr("<unavailable>")); data.setValue(tr("<unavailable>"));
data.setAllUnneeded(); data.setAllUnneeded();
insertData(data); insertData(data);
...@@ -3743,10 +3747,12 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals) ...@@ -3743,10 +3747,12 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
WatchData data; WatchData data;
QString nam = _(name); QString nam = _(name);
data.iname = _("local.") + nam + QString::number(n + 1); data.iname = _("local.") + nam + QString::number(n + 1);
//: Variable %1 <FIXME: does something - bug Andre about it>
data.name = tr("%1 <shadowed %2>").arg(nam, n); data.name = tr("%1 <shadowed %2>").arg(nam, n);
//data.setValue("<shadowed>"); //data.setValue("<shadowed>");
setWatchDataValue(data, item.findChild("value")); setWatchDataValue(data, item.findChild("value"));
data.setType(_("<shadowed>")); //: Type of variable <FIXME: what? bug Andre about it>
data.setType(tr("<shadowed>"));
data.setChildCount(0); data.setChildCount(0);
insertData(data); insertData(data);
} else { } else {
...@@ -3905,7 +3911,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item, ...@@ -3905,7 +3911,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
data.exp = parent.exp; data.exp = parent.exp;
data.name = tr("<n/a>"); data.name = tr("<n/a>");
data.iname = parent.iname + _(".@"); data.iname = parent.iname + _(".@");
data.type = _("<anonymous union>"); data.type = tr("<anonymous union>");
} else { } else {
// A structure. Hope there's nothing else... // A structure. Hope there's nothing else...
data.exp = parent.exp + _c('.') + data.name; data.exp = parent.exp + _c('.') + data.name;
...@@ -3942,6 +3948,7 @@ void GdbEngine::handleVarListChildren(const GdbResultRecord &record, ...@@ -3942,6 +3948,7 @@ void GdbEngine::handleVarListChildren(const GdbResultRecord &record,
// if the class really has no children // if the class really has no children
WatchData data1; WatchData data1;
data1.iname = data.iname + _(".child"); data1.iname = data.iname + _(".child");
//: About variable's value
data1.value = tr("<no information>"); data1.value = tr("<no information>");
data1.childCount = 0; data1.childCount = 0;
data1.setAllUnneeded(); data1.setAllUnneeded();
...@@ -3975,7 +3982,7 @@ void GdbEngine::handleToolTip(const GdbResultRecord &record, ...@@ -3975,7 +3982,7 @@ void GdbEngine::handleToolTip(const GdbResultRecord &record,
if (what == "evaluate") { if (what == "evaluate") {
QByteArray msg = record.data.findChild("msg").data(); QByteArray msg = record.data.findChild("msg").data();
if (msg.startsWith("Cannot look up value of a typedef")) { if (msg.startsWith("Cannot look up value of a typedef")) {
m_toolTip.value = m_toolTip.exp + " is a typedef."; m_toolTip.value = tr("%1 is a typedef.").arg(m_toolTip.exp);
//return; //return;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment