From ce633d57fb6995b84d36899b9d18ac207128f4b2 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Thu, 18 Aug 2011 15:17:53 +0200 Subject: [PATCH] QmlProfiler: make strings translatable Task-number: QTCREATORBUG-5747 Change-Id: If15bb749e641ed181dbfee3400c18d52bc88e5fb Reviewed-on: http://codereview.qt.nokia.com/3188 Reviewed-by: Qt Sanity Bot Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qml/MainView.js | 2 +- src/plugins/qmlprofiler/qml/MainView.qml | 11 +++++------ src/plugins/qmlprofiler/qml/RangeDetails.qml | 9 +++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/plugins/qmlprofiler/qml/MainView.js b/src/plugins/qmlprofiler/qml/MainView.js index a95df7daeef..d113e181511 100644 --- a/src/plugins/qmlprofiler/qml/MainView.js +++ b/src/plugins/qmlprofiler/qml/MainView.js @@ -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" ]; diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 025eac39b57..9e01573048b 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -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 diff --git a/src/plugins/qmlprofiler/qml/RangeDetails.qml b/src/plugins/qmlprofiler/qml/RangeDetails.qml index 7b4207f0afe..03605f1859d 100644 --- a/src/plugins/qmlprofiler/qml/RangeDetails.qml +++ b/src/plugins/qmlprofiler/qml/RangeDetails.qml @@ -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("/")