QML UI: allow magic phrase for multiple buddies to be localized

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-01-22 17:23:55 -08:00
parent 0196d9a220
commit b15b3c195c
4 changed files with 4 additions and 4 deletions

View file

@ -425,7 +425,7 @@ QStringList DiveObjectHelper::buddyList() const
QRegExp sep("(,\\s)"); QRegExp sep("(,\\s)");
QStringList tempList = temp.split(sep); QStringList tempList = temp.split(sep);
buddies << tempList; buddies << tempList;
buddies << "Multiple Buddies"; buddies << tr("Multiple Buddies");
} }
} }
buddies.removeDuplicates(); buddies.removeDuplicates();

View file

@ -157,7 +157,7 @@ Kirigami.Page {
watertemp = diveDetailsListView.currentItem.modelData.dive.waterTemp watertemp = diveDetailsListView.currentItem.modelData.dive.waterTemp
suitIndex = diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit) suitIndex = diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
if (diveDetailsListView.currentItem.modelData.dive.buddy.indexOf(",") > 0) { if (diveDetailsListView.currentItem.modelData.dive.buddy.indexOf(",") > 0) {
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf("Multiple Buddies"); buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(qsTr("Multiple Buddies"));
} else { } else {
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy) buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
} }

View file

@ -177,7 +177,7 @@ Item {
} }
ComboBox { ComboBox {
id: buddyBox id: buddyBox
editable: currentText != "Multiple Buddies" editable: currentText != qsTr("Multiple Buddies")
model: diveDetailsListView.currentItem.modelData.dive.buddyList model: diveDetailsListView.currentItem.modelData.dive.buddyList
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -870,7 +870,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
} }
if (myDive->buddy() != buddy) { if (myDive->buddy() != buddy) {
if (myDive->buddy().contains(",")) { if (myDive->buddy().contains(",")) {
if (!buddy.contains("Multiple Buddies")) { if (!buddy.contains(tr("Multiple Buddies"))) {
diveChanged = true; diveChanged = true;
free(d->buddy); free(d->buddy);
d->buddy = strdup(qPrintable(buddy)); d->buddy = strdup(qPrintable(buddy));