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