diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-08-26 10:30:41 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-26 10:30:41 -0700 |
commit | 47226912b64f126f85ed4f65d8df010b6194b313 (patch) | |
tree | ed6cbbc487c6d7c771bb3ee07f72a096912bf287 /qt-ui | |
parent | 18da0b1911b095ac11a35b5ade82403310f49c74 (diff) | |
download | subsurface-47226912b64f126f85ed4f65d8df010b6194b313.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/updatemanager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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.<br/>Click on:<br/><a href=\"%1\">%1</a><br/> to download it.") .arg(responseBody); } else if (responseBody.startsWith("Latest version")) { - msgText = tr("<b>A new version of subsurface is available.</b><br/><br/>%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("<b>") + tr("A new version of subsurface is available.") + QString("</b><br/><br/>") + + 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.<br/><br/>%1").arg(responseBody); msgbox.setIcon(QMessageBox::Warning); } |