mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
Hook up plurality to OSD messages
This commit is contained in:
parent
948a6b530b
commit
6350bb0e36
|
@ -41,6 +41,51 @@
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>OSDMessage</name>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>Loaded %n cheats from list.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>Loaded %n cheat from list.</numerusform>
|
||||||
|
<numerusform>Loaded %n cheats from list.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source> %n cheats are enabled.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform> %n cheat is enabled.</numerusform>
|
||||||
|
<numerusform> %n cheats are enabled.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n cheats are now active.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>%n cheat is now active.</numerusform>
|
||||||
|
<numerusform>%n cheats are now active.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n cheats are now inactive.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>%n cheat is now inactive.</numerusform>
|
||||||
|
<numerusform>%n cheats are now inactive.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>Loaded %n cheats from database.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>Loaded %n cheat from database.</numerusform>
|
||||||
|
<numerusform>Loaded %n cheats from database.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>Saved %n cheats to '%s'.</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>Saved %n cheat to '%s'.</numerusform>
|
||||||
|
<numerusform>Saved %n cheats to '%s'.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QtHostInterface</name>
|
<name>QtHostInterface</name>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
|
|
|
@ -1273,10 +1273,10 @@ void CommonHostInterface::DoToggleCheats()
|
||||||
}
|
}
|
||||||
|
|
||||||
cl->SetMasterEnable(!cl->GetMasterEnable());
|
cl->SetMasterEnable(!cl->GetMasterEnable());
|
||||||
AddFormattedOSDMessage(10.0f,
|
AddOSDMessage(cl->GetMasterEnable() ?
|
||||||
cl->GetMasterEnable() ? TranslateString("OSDMessage", "%u cheats are now active.") :
|
TranslateStdString("OSDMessage", "%n cheats are now active.", "", cl->GetEnabledCodeCount()) :
|
||||||
TranslateString("OSDMessage", "%u cheats are now inactive."),
|
TranslateStdString("OSDMessage", "%n cheats are now inactive.", "", cl->GetEnabledCodeCount()),
|
||||||
cl->GetEnabledCodeCount());
|
10.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<CommonHostInterface::HostKeyCode>
|
std::optional<CommonHostInterface::HostKeyCode>
|
||||||
|
@ -3041,8 +3041,9 @@ bool CommonHostInterface::LoadCheatList(const char* filename)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddFormattedOSDMessage(10.0f, TranslateString("OSDMessage", "Loaded %u cheats from list. %u cheats are enabled."),
|
AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from list.", "", cl->GetCodeCount()) +
|
||||||
cl->GetCodeCount(), cl->GetEnabledCodeCount());
|
TranslateStdString("OSDMessage", " %n cheats are enabled.", "", cl->GetEnabledCodeCount()),
|
||||||
|
10.0f);
|
||||||
System::SetCheatList(std::move(cl));
|
System::SetCheatList(std::move(cl));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3068,7 +3069,7 @@ bool CommonHostInterface::LoadCheatListFromDatabase()
|
||||||
if (!cl->LoadFromPackage(System::GetRunningCode()))
|
if (!cl->LoadFromPackage(System::GetRunningCode()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AddFormattedOSDMessage(10.0f, TranslateString("OSDMessage", "Loaded %u cheats from database."), cl->GetCodeCount());
|
AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from database.", "", cl->GetCodeCount()), 10.0f);
|
||||||
System::SetCheatList(std::move(cl));
|
System::SetCheatList(std::move(cl));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3098,8 +3099,9 @@ bool CommonHostInterface::SaveCheatList(const char* filename)
|
||||||
if (!System::GetCheatList()->SaveToPCSXRFile(filename))
|
if (!System::GetCheatList()->SaveToPCSXRFile(filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Saved %u cheats to '%s'."),
|
// This shouldn't be needed, but lupdate doesn't gather this string otherwise...
|
||||||
System::GetCheatList()->GetCodeCount(), filename);
|
const u32 code_count = System::GetCheatList()->GetCodeCount();
|
||||||
|
AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Saved %n cheats to '%s'.", "", code_count), filename);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue