Allow localization of pairing error strings

This commit is contained in:
Cameron Gutman 2022-10-12 22:20:15 -05:00
commit 8d087ba5b1

View file

@ -478,18 +478,18 @@ private:
switch (result) switch (result)
{ {
case NvPairingManager::PairState::PIN_WRONG: case NvPairingManager::PairState::PIN_WRONG:
emit pairingCompleted(m_Computer, "The PIN from the PC didn't match. Please try again."); emit pairingCompleted(m_Computer, tr("The PIN from the PC didn't match. Please try again."));
break; break;
case NvPairingManager::PairState::FAILED: case NvPairingManager::PairState::FAILED:
if (m_Computer->currentGameId != 0) { if (m_Computer->currentGameId != 0) {
emit pairingCompleted(m_Computer, "You cannot pair while a previous session is still running on the host PC. Quit any running games or reboot the host PC, then try pairing again."); emit pairingCompleted(m_Computer, tr("You cannot pair while a previous session is still running on the host PC. Quit any running games or reboot the host PC, then try pairing again."));
} }
else { else {
emit pairingCompleted(m_Computer, "Pairing failed. Please try again."); emit pairingCompleted(m_Computer, tr("Pairing failed. Please try again."));
} }
break; break;
case NvPairingManager::PairState::ALREADY_IN_PROGRESS: case NvPairingManager::PairState::ALREADY_IN_PROGRESS:
emit pairingCompleted(m_Computer, "Another pairing attempt is already in progress."); emit pairingCompleted(m_Computer, tr("Another pairing attempt is already in progress."));
break; break;
case NvPairingManager::PairState::PAIRED: case NvPairingManager::PairState::PAIRED:
// Persist the newly pinned server certificate for this host // Persist the newly pinned server certificate for this host
@ -499,7 +499,7 @@ private:
break; break;
} }
} catch (const GfeHttpResponseException& e) { } catch (const GfeHttpResponseException& e) {
emit pairingCompleted(m_Computer, "GeForce Experience returned error: " + e.toQString()); emit pairingCompleted(m_Computer, tr("GeForce Experience returned error: %1").arg(e.toQString()));
} catch (const QtNetworkReplyException& e) { } catch (const QtNetworkReplyException& e) {
emit pairingCompleted(m_Computer, e.toQString()); emit pairingCompleted(m_Computer, e.toQString());
} }