From 47226912b64f126f85ed4f65d8df010b6194b313 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Aug 2014 10:30:41 -0700 Subject: Fix missing translations for webservice responses The webservice backend sends responses in English. Let's do a better job presenting those in the users preferred language. Fixes #714 Signed-off-by: Dirk Hohndel --- qt-ui/updatemanager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp index 4ea9f188e..ad29da5dc 100644 --- a/qt-ui/updatemanager.cpp +++ b/qt-ui/updatemanager.cpp @@ -61,9 +61,18 @@ void UpdateManager::requestReceived() msgText = tr("A new version of subsurface is available.
Click on:
%1
to download it.") .arg(responseBody); } else if (responseBody.startsWith("Latest version")) { - msgText = tr("A new version of subsurface is available.

%1") + // the webservice backend doesn't localize - but it's easy enough to just replace the + // strings that it is likely to send back + responseBody.replace("Latest version is ", ""); + responseBody.replace(". please check with your OS vendor for updates.", ""); + msgText = QString("") + tr("A new version of subsurface is available.") + QString("

") + + tr("Latest version is %1, please check with your OS vendor for updates.") .arg(responseBody); } else { + // the webservice backend doesn't localize - but it's easy enough to just replace the + // strings that it is likely to send back + if (responseBody.contains("Newest release version is ")) + responseBody.replace("Newest release version is ", tr("Newest release version is ")); msgText = tr("There was an error while trying to check for updates.

%1").arg(responseBody); msgbox.setIcon(QMessageBox::Warning); } -- cgit v1.2.3-70-g09d2