QmlProfiler: make strings translatable

Task-number: QTCREATORBUG-5747

Change-Id: If15bb749e641ed181dbfee3400c18d52bc88e5fb
Reviewed-on: http://codereview.qt.nokia.com/3188
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-08-18 15:17:53 +02:00
parent 8d2f0376e2
commit ce633d57fb
3 changed files with 9 additions and 13 deletions

View File

@@ -36,7 +36,7 @@ var xmargin = 0;
var ymargin = 0;
var qmlEventList = 0;
var names = [ "Painting", "Compiling", "Creating", "Binding", "Handling Signal"]
var names = [ qsTr("Painting"), qsTr("Compiling"), qsTr("Creating"), qsTr("Binding"), qsTr("Handling Signal")]
//### need better way to manipulate color from QML. In the meantime, these need to be kept in sync.
var colors = [ "#99CCB3", "#99CCCC", "#99B3CC", "#9999CC", "#CC99B3", "#CC99CC", "#CCCC99", "#CCB399" ];
var origColors = [ "#99CCB3", "#99CCCC", "#99B3CC", "#9999CC", "#CC99B3", "#CC99CC", "#CCCC99", "#CCB399" ];

View File

@@ -172,7 +172,6 @@ Rectangle {
reset = false
}
var time = (new Date() - startDate)/1000
//elapsed.text = time.toFixed(1) + "s"
root.elapsedTime = time.toFixed(1);
root.updateTimer();
}
@@ -390,11 +389,11 @@ Rectangle {
Column {
id: col
//### change to use Repeater + Plotter.names?
Label { text: "Painting"; height: labels.height/labels.rowCount}
Label { text: "Compiling"; height: labels.height/labels.rowCount }
Label { text: "Creating"; height: labels.height/labels.rowCount }
Label { text: "Binding"; height: labels.height/labels.rowCount }
Label { text: "Signal Handler"; height: labels.height/labels.rowCount }
Label { text: qsTr("Painting"); height: labels.height/labels.rowCount}
Label { text: qsTr("Compiling"); height: labels.height/labels.rowCount }
Label { text: qsTr("Creating"); height: labels.height/labels.rowCount }
Label { text: qsTr("Binding"); height: labels.height/labels.rowCount }
Label { text: qsTr("Signal Handler"); height: labels.height/labels.rowCount }
}
//right border divider

View File

@@ -70,23 +70,20 @@ BorderImage {
anchors.top: typeTitle.bottom
x: 2
Detail {
label: "Duration"
label: qsTr("Duration")
content: rangeDetails.duration < 1000 ?
rangeDetails.duration + "μs" :
Math.floor(rangeDetails.duration/10)/100 + "ms"
}
Detail {
opacity: content.length !== 0 ? 1 : 0
label: "Details"
label: qsTr("Details")
content: {
var inputString = rangeDetails.label;
if (inputString.length > 7 && inputString.substring(0,7) == "file://") {
var pos = inputString.lastIndexOf("/");
return inputString.substr(pos+1);
}
// transform code blocks into oneliners
inputString = inputString.replace("\n", " ");
var maxLen = 40;
if (inputString.length > maxLen)
inputString = inputString.substring(0,maxLen)+"...";
@@ -96,7 +93,7 @@ BorderImage {
}
Detail {
opacity: content.length !== 0 ? 1 : 0
label: "Location"
label: qsTr("Location")
content: {
var file = rangeDetails.file
var pos = file.lastIndexOf("/")