diff --git a/es-app/src/guis/GuiOfflineGenerator.cpp b/es-app/src/guis/GuiOfflineGenerator.cpp index 282e9f1d8..56917db51 100644 --- a/es-app/src/guis/GuiOfflineGenerator.cpp +++ b/es-app/src/guis/GuiOfflineGenerator.cpp @@ -44,10 +44,12 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue& gameQueue) mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mStatus, glm::ivec2 {0, 1}, false, true, glm::ivec2 {6, 1}); - mGameCounter = std::make_shared( - std::to_string(mGamesProcessed) + " OF " + std::to_string(mTotalGames) + - (mTotalGames == 1 ? " GAME " : " GAMES ") + "PROCESSED", - Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, ALIGN_CENTER); + const std::string gameProcessText {Utils::String::format( + _n("%i OF %i GAME PROCESSED", "%i OF %i GAMES PROCESSED", mTotalGames), mGamesProcessed, + mTotalGames)}; + + mGameCounter = std::make_shared(gameProcessText, Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_CENTER); mGrid.setEntry(mGameCounter, glm::ivec2 {0, 2}, false, true, glm::ivec2 {6, 1}); // Spacer row with top border. @@ -321,15 +323,16 @@ void GuiOfflineGenerator::update(int deltaTime) // Update the statistics. mStatus->setText(_("RUNNING")); - mGameCounter->setText(std::to_string(mGamesProcessed) + " OF " + std::to_string(mTotalGames) + - (mTotalGames == 1 ? " GAME " : " GAMES ") + "PROCESSED"); + mGameCounter->setText(Utils::String::format( + _n("%i OF %i GAME PROCESSED", "%i OF %i GAMES PROCESSED", mTotalGames), mGamesProcessed, + mTotalGames)); mGeneratedVal->setText(std::to_string(mImagesGenerated)); mFailedVal->setText(std::to_string(mGamesFailed)); mOverwrittenVal->setText(std::to_string(mImagesOverwritten)); if (mGamesProcessed == mTotalGames) { - mStatus->setText(_("COMPLETED")); + mStatus->setText(_("COMPLETED [MIXIMAGE GENERATOR]")); mStartPauseButton->setText(_("DONE"), _("done (close)")); mStartPauseButton->setPressedFunc([this]() { delete this; }); mCloseButton->setText(_("CLOSE"), _("close")); diff --git a/es-app/src/guis/GuiOrphanedDataCleanup.cpp b/es-app/src/guis/GuiOrphanedDataCleanup.cpp index 502a12ae7..ddf6eeb5f 100644 --- a/es-app/src/guis/GuiOrphanedDataCleanup.cpp +++ b/es-app/src/guis/GuiOrphanedDataCleanup.cpp @@ -329,7 +329,8 @@ void GuiOrphanedDataCleanup::cleanupMediaFiles() << "\""; { std::unique_lock lock {mMutex}; - mErrorMessage = "A flatten.txt file was found, skipping \"" + currentSystem + "\""; + mErrorMessage = Utils::String::format( + _("A flatten.txt file was found, skipping \"%s\""), currentSystem.c_str()); } continue; } @@ -522,7 +523,8 @@ void GuiOrphanedDataCleanup::cleanupGamelists() << "\""; { std::unique_lock lock {mMutex}; - mErrorMessage = "A flatten.txt file was found, skipping \"" + currentSystem + "\""; + mErrorMessage = Utils::String::format( + _("A flatten.txt file was found, skipping \"%s\""), currentSystem.c_str()); } continue; } @@ -549,8 +551,8 @@ void GuiOrphanedDataCleanup::cleanupGamelists() LOG(LogError) << "Couldn't parse file \"" << gamelistFile << "\""; { std::unique_lock lock {mMutex}; - mErrorMessage = - "Couldn't parse gamelist.xml file for \"" + system->getName() + "\""; + mErrorMessage = Utils::String::format( + _("Couldn't parse gamelist.xml file for \"%s\""), system->getName().c_str()); } SDL_Delay(500); continue; @@ -575,7 +577,8 @@ void GuiOrphanedDataCleanup::cleanupGamelists() { std::unique_lock lock {mMutex}; mErrorMessage = - "Couldn't find a gamelist tag in file for system \"" + system->getName() + "\""; + Utils::String::format(_("Couldn't find a gamelist tag in file for \"%s\""), + system->getName().c_str()); } SDL_Delay(500); continue; diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index 167312f16..adc4a1bd1 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -223,11 +223,10 @@ void GuiScraperMulti::doNextSearch() std::stringstream ss; if (mQueueCountPerSystem.size() > 1) { - // const int gameCount {++mQueueCountPerSystem[mSearchQueue.front().system].first}; const int totalGameCount {mQueueCountPerSystem[mSearchQueue.front().system].second}; + const std::string gameCountText {_n("GAME", "GAMES", totalGameCount)}; mSystem->setText(Utils::String::toUpper(mSearchQueue.front().system->getFullName()) + " [" + - std::to_string(totalGameCount) + " GAME" + - (totalGameCount == 1 ? "]" : "S]")); + std::to_string(totalGameCount) + " " + gameCountText + "]"); } else { mSystem->setText(Utils::String::toUpper(mSearchQueue.front().system->getFullName())); @@ -269,8 +268,9 @@ void GuiScraperMulti::doNextSearch() // Update subtitle. ss.str(""); - ss << "GAME " << (mCurrentGame + 1) << " OF " << mTotalGames << " - " << folderPath - << scrapeName + const std::string gameCounterText { + Utils::String::format(_("GAME %i OF %i"), mCurrentGame + 1, mTotalGames)}; + ss << gameCounterText << " - " << folderPath << scrapeName << ((mSearchQueue.front().game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""); mSubtitle->setText(ss.str()); @@ -313,12 +313,14 @@ void GuiScraperMulti::finish() ss << _("NO GAMES WERE SCRAPED"); } else { - ss << mTotalSuccessful << " GAME" << ((mTotalSuccessful > 1) ? "S" : "") - << " SUCCESSFULLY SCRAPED"; + ss << Utils::String::format( + _n("%i GAME SUCCESSFULLY SCRAPED", "%i GAMES SUCCESSFULLY SCRAPED", mTotalSuccessful), + mTotalSuccessful); if (mTotalSkipped > 0) ss << "\n" - << mTotalSkipped << " GAME" << ((mTotalSkipped > 1) ? "S" : "") << " SKIPPED"; + << Utils::String::format(_n("%i GAME SKIPPED", "%i GAMES SKIPPED", mTotalSkipped), + mTotalSkipped); } // Pressing either OK or using the back button should delete us. diff --git a/es-core/src/guis/GuiDetectDevice.cpp b/es-core/src/guis/GuiDetectDevice.cpp index 60ea26a63..6ac8a4819 100644 --- a/es-core/src/guis/GuiDetectDevice.cpp +++ b/es-core/src/guis/GuiDetectDevice.cpp @@ -45,10 +45,13 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun, std::stringstream deviceInfo; int numDevices {InputManager::getInstance().getNumJoysticks()}; - if (numDevices > 0) - deviceInfo << numDevices << " GAMEPAD" << (numDevices > 1 ? "S" : "") << " DETECTED"; - else + if (numDevices > 0) { + deviceInfo << Utils::String::format( + _n("%i GAMEPAD DETECTED", "%i GAMEPADS DETECTED", numDevices), numDevices); + } + else { deviceInfo << _("NO GAMEPADS DETECTED"); + } if (numDevices > 1 && Settings::getInstance()->getBool("InputOnlyFirstController")) deviceInfo << " " << _("(ONLY ACCEPTING INPUT FROM FIRST CONTROLLER)");