Achievements: Login error notification should be translatable

This commit is contained in:
Stenzek 2025-01-12 19:16:22 +10:00
parent 19ee37cd10
commit d3ee12d358
No known key found for this signature in database
1 changed files with 5 additions and 3 deletions

View File

@ -2021,14 +2021,16 @@ void Achievements::ClientLoginWithTokenCallback(int result, const char* error_me
// only display user error if they've started a game // only display user error if they've started a game
if (System::IsValid()) if (System::IsValid())
{ {
std::string message = std::string message = fmt::format(
fmt::format("Achievement unlocks will not be submitted for this session.\nError: {}", error_message); TRANSLATE_FS("Achievements", "Achievement unlocks will not be submitted for this session.\nError: {}"),
error_message);
GPUThread::RunOnThread([message = std::move(message)]() mutable { GPUThread::RunOnThread([message = std::move(message)]() mutable {
if (!GPUThread::HasGPUBackend() || !FullscreenUI::Initialize()) if (!GPUThread::HasGPUBackend() || !FullscreenUI::Initialize())
return; return;
ImGuiFullscreen::AddNotification("AchievementsLoginFailed", Host::OSD_ERROR_DURATION, ImGuiFullscreen::AddNotification("AchievementsLoginFailed", Host::OSD_ERROR_DURATION,
"RetroAchievements Login Failed", std::move(message), "images/warning.svg"); TRANSLATE_STR("Achievements", "RetroAchievements Login Failed"),
std::move(message), "images/warning.svg");
}); });
} }