Merge branch 'localize_screenshot' into 'master'

Localize screenshot messages

See merge request OpenMW/openmw!3843
pull/3234/head
Alexei Kotov 11 months ago
commit 3301ebb2cb

@ -14,6 +14,7 @@
#include <components/debug/gldebug.hpp>
#include <components/misc/rng.hpp>
#include <components/misc/strings/format.hpp>
#include <components/vfs/manager.hpp>
#include <components/vfs/registerarchives.hpp>
@ -109,10 +110,23 @@ namespace
profiler.removeUserStatsLine(" -Async");
}
struct ScheduleNonDialogMessageBox
struct ScreenCaptureMessageBox
{
void operator()(std::string message) const
void operator()(std::string filePath) const
{
if (filePath.empty())
{
MWBase::Environment::get().getWindowManager()->scheduleMessageBox(
"#{OMWEngine:ScreenshotFailed}", MWGui::ShowInDialogueMode_Never);
return;
}
std::string messageFormat
= MWBase::Environment::get().getL10nManager()->getMessage("OMWEngine", "ScreenshotMade");
std::string message = Misc::StringUtils::format(messageFormat, filePath);
MWBase::Environment::get().getWindowManager()->scheduleMessageBox(
std::move(message), MWGui::ShowInDialogueMode_Never);
}
@ -717,8 +731,7 @@ void OMW::Engine::prepareEngine()
mScreenCaptureOperation = new SceneUtil::AsyncScreenCaptureOperation(mWorkQueue,
new SceneUtil::WriteScreenshotToFileOperation(mCfgMgr.getScreenshotPath(),
Settings::general().mScreenshotFormat,
Settings::general().mNotifyOnSavedScreenshot
? std::function<void(std::string)>(ScheduleNonDialogMessageBox{})
Settings::general().mNotifyOnSavedScreenshot ? std::function<void(std::string)>(ScreenCaptureMessageBox{})
: std::function<void(std::string)>(IgnoreString{})));
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);

@ -122,10 +122,10 @@ namespace SceneUtil
<< mScreenshotFormat << "\": " << e.what();
}
if (fileName.empty())
mCallback("Failed to save screenshot");
mCallback(std::string());
else
{
mCallback(Files::pathToUnicodeString(fileName) + " has been saved");
mCallback(Files::pathToUnicodeString(fileName));
Log(Debug::Info) << mScreenshotPath / fileName << " has been saved";
}
}

@ -29,9 +29,11 @@ BuildingNavigationMesh: "Baue Navigationsgitter"
# This save file was created using an older version of OpenMW in a format that is no longer supported.
# Load and save this file using {version} to upgrade it.
#NewGameConfirmation: "Do you want to start a new game and lose the current one?"
#QuitGameConfirmation: "Quit the game?"
#SaveGameDenied: "The game cannot be saved right now."
#SavingInProgress: "Saving..."
#QuitGameConfirmation: "Quit the game?"
#ScreenshotFailed: "Failed to save screenshot"
#ScreenshotMade: "%s has been saved"
# Save game menu

@ -26,9 +26,11 @@ LoadingRequiresOldVersionError: |-
This save file was created using an older version of OpenMW in a format that is no longer supported.
Load and save this file using {version} to upgrade it.
NewGameConfirmation: "Do you want to start a new game and lose the current one?"
QuitGameConfirmation: "Quit the game?"
SaveGameDenied: "The game cannot be saved right now."
SavingInProgress: "Saving..."
QuitGameConfirmation: "Quit the game?"
ScreenshotFailed: "Failed to save screenshot"
ScreenshotMade: "%s has been saved"
# Save game menu

@ -26,9 +26,11 @@ LoadingRequiresNewVersionError: |-
# This save file was created using an older version of OpenMW in a format that is no longer supported.
# Load and save this file using {version} to upgrade it.
NewGameConfirmation: "Voulez-vous démarrer une nouvelle partie ? Toute progression non sauvegardée sera perdue."
QuitGameConfirmation: "Quitter la partie ?"
SaveGameDenied: "Sauvegarde impossible"
SavingInProgress: "Sauvegarde en cours..."
QuitGameConfirmation: "Quitter la partie ?"
#ScreenshotFailed: "Failed to save screenshot"
#ScreenshotMade: "%s has been saved"
# Save game menu

@ -26,9 +26,11 @@ LoadingRequiresOldVersionError: |-
Это сохранение создано старой версией OpenMW и использует формат, который больше не поддерживается.
Загрузите и сохраните этот файл в {version}, чтобы обновить его.
NewGameConfirmation: "Вы хотите начать новую игру? Текущая игра будет потеряна."
QuitGameConfirmation: "Выйти из игры?"
SaveGameDenied: "В данный момент игру нельзя сохранить."
SavingInProgress: "Сохранение..."
QuitGameConfirmation: "Выйти из игры?"
ScreenshotFailed: "Не удалось создать снимок экрана"
ScreenshotMade: "Создан снимок экрана %s"
# Save game menu

@ -26,9 +26,11 @@ LoadingRequiresNewVersionError: |-
# This save file was created using an older version of OpenMW in a format that is no longer supported.
# Load and save this file using {version} to upgrade it.
NewGameConfirmation: "Vill du starta ett nytt spel och förlora det pågående spelet?"
QuitGameConfirmation: "Avsluta spelet?"
SaveGameDenied: "Spelet kan inte sparas just nu."
SavingInProgress: "Sparar..."
QuitGameConfirmation: "Avsluta spelet?"
#ScreenshotFailed: "Failed to save screenshot"
#ScreenshotMade: "%s has been saved"
# Save game menu

Loading…
Cancel
Save