Commit ffb9df57 authored by Sergey Belyashov's avatar Sergey Belyashov Committed by Oswald Buddenhagen
Browse files

Added possibility to translate special texts in Environment Editor.



Covers <UNSET>, <VARIABLE>, <VALUE>.

Merge-request: 1156
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
parent 452a565e
...@@ -56,7 +56,7 @@ void EnvironmentModel::updateResultEnvironment() ...@@ -56,7 +56,7 @@ void EnvironmentModel::updateResultEnvironment()
m_resultEnvironment.modify(m_items); m_resultEnvironment.modify(m_items);
foreach (const EnvironmentItem &item, m_items) { foreach (const EnvironmentItem &item, m_items) {
if (item.unset) { if (item.unset) {
m_resultEnvironment.set(item.name, QLatin1String("<UNSET>")); m_resultEnvironment.set(item.name, tr("<UNSET>"));
} }
} }
} }
...@@ -128,7 +128,7 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const ...@@ -128,7 +128,7 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row()); return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row());
} else { } else {
if (m_items.at(index.row()).unset) if (m_items.at(index.row()).unset)
return QLatin1String("<UNSET>"); return tr("<UNSET>");
else else
return m_items.at(index.row()).value; return m_items.at(index.row()).value;
} }
...@@ -286,7 +286,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, ...@@ -286,7 +286,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
QModelIndex EnvironmentModel::addVariable() QModelIndex EnvironmentModel::addVariable()
{ {
const QString &name = QLatin1String("<VARIABLE>"); const QString name = tr("<VARIABLE>");
if (m_mergedEnvironments) { if (m_mergedEnvironments) {
int i = findInResult(name); int i = findInResult(name);
if (i != -1) if (i != -1)
...@@ -297,7 +297,7 @@ QModelIndex EnvironmentModel::addVariable() ...@@ -297,7 +297,7 @@ QModelIndex EnvironmentModel::addVariable()
return index(i, 0, QModelIndex()); return index(i, 0, QModelIndex());
} }
// Don't exist, really add them // Don't exist, really add them
return addVariable(EnvironmentItem(name, QLatin1String("<VALUE>"))); return addVariable(EnvironmentItem(name, tr("<VALUE>")));
} }
QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item) QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
...@@ -558,10 +558,12 @@ void EnvironmentWidget::updateSummaryText() ...@@ -558,10 +558,12 @@ void EnvironmentWidget::updateSummaryText()
foreach (const EnvironmentItem &item, list) { foreach (const EnvironmentItem &item, list) {
if (!text.isEmpty()) if (!text.isEmpty())
text.append("<br>"); text.append("<br>");
if (item.unset) if (item.name != EnvironmentModel::tr("<VARIABLE>")) {
text.append(tr("Unset <b>%1</b>").arg(item.name)); if (item.unset)
else text.append(tr("Unset <b>%1</b>").arg(item.name));
text.append(tr("Set <b>%1</b> to <b>%2</b>").arg(item.name, item.value)); else
text.append(tr("Set <b>%1</b> to <b>%2</b>").arg(item.name, item.value));
}
} }
if (text.isEmpty()) if (text.isEmpty())
text = tr("Summary: No changes to Environment"); text = tr("Summary: No changes to Environment");
......
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