I18N: Switch to getting categories by index instead of by string lookup

Also gets rid of the shared_ptr usage, and generally makes things nicer.

Needed for later config refactorings, good to get in early.
This commit is contained in:
Henrik Rydgård
2023-04-06 00:34:50 +02:00
parent 07b8b6f35a
commit ee6234ecb6
65 changed files with 535 additions and 516 deletions
+4 -4
View File
@@ -301,7 +301,7 @@ bool GameManager::InstallGame(Path url, Path fileName, bool deleteAfter) {
return InstallRawISO(fileName, shortFilename, deleteAfter);
}
auto sy = GetI18NCategory("System");
auto sy = GetI18NCategory(I18NCat::SYSTEM);
installInProgress_ = true;
Path pspGame = GetSysDirectory(DIRECTORY_GAME);
@@ -352,7 +352,7 @@ bool GameManager::InstallGame(Path url, Path fileName, bool deleteAfter) {
}
bool GameManager::DetectTexturePackDest(struct zip *z, int iniIndex, Path &dest) {
auto iz = GetI18NCategory("InstallZip");
auto iz = GetI18NCategory(I18NCat::INSTALLZIP);
struct zip_stat zstat;
zip_stat_index(z, iniIndex, 0, &zstat);
@@ -532,7 +532,7 @@ bool GameManager::InstallMemstickGame(struct zip *z, const Path &zipfile, const
size_t allBytes = 0;
size_t bytesCopied = 0;
auto sy = GetI18NCategory("System");
auto sy = GetI18NCategory(I18NCat::SYSTEM);
auto fileAllowed = [&](const char *fn) {
if (!allowRoot && strchr(fn, '/') == 0)
@@ -630,7 +630,7 @@ bool GameManager::InstallMemstickZip(struct zip *z, const Path &zipfile, const P
size_t allBytes = 0;
size_t bytesCopied = 0;
auto sy = GetI18NCategory("System");
auto sy = GetI18NCategory(I18NCat::SYSTEM);
// We don't need the zip anymore, as we're going to copy it as-is.
zip_close(z);