Permalink
Browse files

I18N: Make many more GUI MessageDialog strings translatable

  • Loading branch information...
1 parent ba75871 commit 06bbb57ad71103ac34e607c04798efae78a28880 @criezy criezy committed Jun 13, 2011
@@ -26,6 +26,7 @@
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/translation.h"
#include "backends/events/default/default-events.h"
#include "backends/keymapper/keymapper.h"
#include "backends/keymapper/remap-dialog.h"
@@ -218,7 +219,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
if (ConfMan.getBool("confirm_exit")) {
if (g_engine)
g_engine->pauseEngine(true);
- GUI::MessageDialog alert("Do you really want to return to the Launcher?", "Launcher", "Cancel");
+ GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel"));
result = _shouldRTL = (alert.runModal() == GUI::kMessageOK);
if (g_engine)
g_engine->pauseEngine(false);
@@ -240,7 +241,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_confirmExitDialogActive = true;
if (g_engine)
g_engine->pauseEngine(true);
- GUI::MessageDialog alert("Do you really want to quit?", "Quit", "Cancel");
+ GUI::MessageDialog alert(_("Do you really want to quit?"), _("Quit"), _("Cancel"));
result = _shouldQuit = (alert.runModal() == GUI::kMessageOK);
if (g_engine)
g_engine->pauseEngine(false);
@@ -335,9 +335,9 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
const char *dialogMsg;
if (_mouseClickAndDragEnabled) {
_touchpadModeEnabled = false;
- dialogMsg = "Mouse-click-and-drag mode enabled.";
+ dialogMsg = _("Mouse-click-and-drag mode enabled.");
} else
- dialogMsg = "Mouse-click-and-drag mode disabled.";
+ dialogMsg = _("Mouse-click-and-drag mode disabled.");
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return false;
@@ -29,6 +29,7 @@
#include "common/file.h"
#include "common/system.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "graphics/cursorman.h"
#include "graphics/palette.h"
@@ -540,10 +541,8 @@ MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name) {
return new MoviePlayerSMK(vm, baseName);
}
- char buf[60];
-
- sprintf(buf, "Cutscene file '%s' not found!", baseName);
- GUI::MessageDialog dialog(buf, "OK");
+ Common::String buf = Common::String::format(_("Cutscene file '%s' not found!"), baseName);
+ GUI::MessageDialog dialog(buf, _("OK"));
dialog.runModal();
return NULL;
View
@@ -143,9 +143,9 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
break;
case kHelpCmd: {
GUI::MessageDialog dialog(
- "Sorry, this engine does not currently provide in-game help. "
+ _("Sorry, this engine does not currently provide in-game help. "
"Please consult the README for basic information, and for "
- "instructions on how to obtain further assistance.");
+ "instructions on how to obtain further assistance."));
dialog.runModal();
}
break;
View
@@ -42,6 +42,7 @@
#include "common/list_intern.h"
#include "common/scummsys.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "gui/debugger.h"
#include "gui/dialog.h"
@@ -216,15 +217,15 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
// Just show warnings then these occur:
#ifdef USE_RGB_COLOR
if (gfxError & OSystem::kTransactionFormatNotSupported) {
- Common::String message = "Could not initialize color format.";
+ Common::String message = _("Could not initialize color format.");
GUI::MessageDialog dialog(message);
dialog.runModal();
}
#endif
if (gfxError & OSystem::kTransactionModeSwitchFailed) {
- Common::String message = "Could not switch to video mode: '";
+ Common::String message = _("Could not switch to video mode: '");
message += ConfMan.get("gfx_mode");
message += "'.";
@@ -233,12 +234,12 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
}
if (gfxError & OSystem::kTransactionAspectRatioFailed) {
- GUI::MessageDialog dialog("Could not apply aspect ratio setting.");
+ GUI::MessageDialog dialog(_("Could not apply aspect ratio setting."));
dialog.runModal();
}
if (gfxError & OSystem::kTransactionFullscreenFailed) {
- GUI::MessageDialog dialog("Could not apply fullscreen setting.");
+ GUI::MessageDialog dialog(_("Could not apply fullscreen setting."));
dialog.runModal();
}
}
@@ -338,22 +339,22 @@ void Engine::checkCD() {
if (GetDriveType(buffer) == DRIVE_CDROM) {
GUI::MessageDialog dialog(
- "You appear to be playing this game directly\n"
+ _("You appear to be playing this game directly\n"
"from the CD. This is known to cause problems,\n"
"and it is therefore recommended that you copy\n"
"the data files to your hard disk instead.\n"
- "See the README file for details.", "OK");
+ "See the README file for details."), _("OK"));
dialog.runModal();
} else {
// If we reached here, the game has audio tracks,
// it's not ran from the CD and the tracks have not
// been ripped.
GUI::MessageDialog dialog(
- "This game has audio tracks in its disk. These\n"
+ _("This game has audio tracks in its disk. These\n"
"tracks need to be ripped from the disk using\n"
"an appropriate CD audio extracting tool in\n"
"order to listen to the game's music.\n"
- "See the README file for details.", "OK");
+ "See the README file for details."), _("OK"));
dialog.runModal();
}
#endif
@@ -22,6 +22,7 @@
#include "common/endian.h"
#include "common/str.h"
+#include "common/translation.h"
#include "gui/message.h"
@@ -252,7 +253,7 @@ void Inter_Playtoons::oPlaytoons_readData(OpFuncParams &params) {
WRITE_VAR(1, 1);
if (!_vm->_saveLoad->load(file.c_str(), dataVar, size, offset)) {
- GUI::MessageDialog dialog("Failed to load game state from file.");
+ GUI::MessageDialog dialog(_("Failed to load game state from file."));
dialog.runModal();
} else
WRITE_VAR(1, 0);
View
@@ -22,6 +22,7 @@
#include "common/endian.h"
#include "common/str.h"
+#include "common/translation.h"
#include "gui/message.h"
@@ -1279,7 +1280,7 @@ void Inter_v2::o2_readData(OpFuncParams &params) {
if (!_vm->_saveLoad->load(file, dataVar, size, offset)) {
- GUI::MessageDialog dialog("Failed to load game state from file.");
+ GUI::MessageDialog dialog(_("Failed to load game state from file."));
dialog.runModal();
} else
@@ -1349,7 +1350,7 @@ void Inter_v2::o2_writeData(OpFuncParams &params) {
if (!_vm->_saveLoad->save(file, dataVar, size, offset)) {
- GUI::MessageDialog dialog("Failed to save game state to file.");
+ GUI::MessageDialog dialog(_("Failed to save game state to file."));
dialog.runModal();
} else
View
@@ -20,6 +20,8 @@
*
*/
+#include "common/translation.h"
+
#include "gui/message.h"
#include "gob/gob.h"
@@ -102,7 +104,7 @@ void Inter_v5::o5_deleteFile() {
if (mode == SaveLoad::kSaveModeSave) {
if (!_vm->_saveLoad->deleteFile(file)) {
- GUI::MessageDialog dialog("Failed to delete file.");
+ GUI::MessageDialog dialog(_("Failed to delete file."));
dialog.runModal();
}
@@ -36,6 +36,7 @@
#include "common/events.h"
#include "common/file.h"
#include "common/macresman.h"
+#include "common/translation.h"
#include "gui/message.h"
@@ -413,7 +414,7 @@ void Script::savegame(uint slot) {
if (!file) {
debugC(9, kGroovieDebugScript, "Save file pointer is null");
- GUI::MessageDialog dialog("Failed to save game", "OK");
+ GUI::MessageDialog dialog(_("Failed to save game"), _("OK"));
dialog.runModal();
return;
}
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/translation.h"
#include "gui/message.h"
@@ -471,11 +472,11 @@ SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *dri
// (This will only happen in The Legend of Kyrandia 1 though, all other
// supported games include special General MIDI tracks).
if (_type == kMidiMT32 && !_nativeMT32) {
- ::GUI::MessageDialog dialog("You appear to be using a General MIDI device,\n"
+ ::GUI::MessageDialog dialog(_("You appear to be using a General MIDI device,\n"
"but your game only supports Roland MT32 MIDI.\n"
"We try to map the Roland MT32 instruments to\n"
"General MIDI ones. After all it might happen\n"
- "that a few tracks will not be correctly played.");
+ "that a few tracks will not be correctly played."));
dialog.runModal();
}
}
View
@@ -22,6 +22,7 @@
#include "common/algorithm.h" // for find()
#include "common/textconsole.h"
+#include "common/translation.h"
#include "gui/dialog.h"
#include "gui/message.h"
@@ -134,7 +135,7 @@ void OrionCallbacks::saveLoadSaveFn(DialogView *view, MenuObject *item) {
bool succeeded = view->vm()->_saveLoad->save(view->_selectedSlot + 1, textItem->getText());
if (!succeeded) {
- GUI::MessageDialog dialog("Save game failed!");
+ GUI::MessageDialog dialog(_("Save game failed!"));
dialog.runModal();
}
@@ -23,6 +23,7 @@
#include "common/savefile.h"
#include "common/config-manager.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "gui/dialog.h"
#include "gui/saveload.h"
@@ -129,8 +130,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) {
void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) {
Common::OutSaveFile *f = getOutSaveFile(slot);
if (f == 0) {
- char buf[32];
- sprintf(buf, "Can't save game in slot %i\n\n", slot);
+ Common::String buf = Common::String::format(_("Can't save game in slot %i\n\n"), slot);
GUI::MessageDialog dialog(buf);
dialog.runModal();
return;
@@ -208,7 +208,7 @@ bool SaveLoad::loadGame() {
doLoadGame(_di);
- GUI::TimedMessageDialog dialog("Loading game...", 1500);
+ GUI::TimedMessageDialog dialog(_("Loading game..."), 1500);
dialog.runModal();
return true;
@@ -223,7 +223,7 @@ bool SaveLoad::saveGame() {
doSaveGame(slot, saveName.c_str());
- GUI::TimedMessageDialog dialog("Saving game...", 1500);
+ GUI::TimedMessageDialog dialog(_("Saving game..."), 1500);
dialog.runModal();
return true;
@@ -276,9 +276,9 @@ void SaveLoad_ns::getGamePartProgress(bool *complete, int size) {
static bool askRenameOldSavefiles() {
GUI::MessageDialog dialog0(
- "ScummVM found that you have old savefiles for Nippon Safes that should be renamed.\n"
+ _("ScummVM found that you have old savefiles for Nippon Safes that should be renamed.\n"
"The old names are no longer supported, so you will not be able to load your games if you don't convert them.\n\n"
- "Press OK to convert them now, otherwise you will be asked next time.\n", "OK", "Cancel");
+ "Press OK to convert them now, otherwise you will be asked next time.\n"), _("OK"), _("Cancel"));
return (dialog0.runModal() != 0);
}
@@ -321,12 +321,11 @@ void SaveLoad_ns::renameOldSavefiles() {
return;
}
- char msg[200];
+ Common::String msg;
if (success == numOldSaves) {
- sprintf(msg, "ScummVM successfully converted all your savefiles.");
+ msg = _("ScummVM successfully converted all your savefiles.");
} else {
- sprintf(msg,
- "ScummVM printed some warnings in your console window and can't guarantee all your files have been converted.\n\n"
+ msg = _("ScummVM printed some warnings in your console window and can't guarantee all your files have been converted.\n\n"
"Please report to the team.");
}
View
@@ -1766,8 +1766,10 @@ void ScummEngine::setupMusic(int midi) {
if (missingFile) {
GUI::MessageDialog dialog(
- "Native MIDI support requires the Roland Upgrade from LucasArts,\n"
- "but " + fileName + " is missing. Using AdLib instead.", "Ok");
+ Common::String::format(
+ _("Native MIDI support requires the Roland Upgrade from LucasArts,\n"
+ "but %s is missing. Using AdLib instead."), fileName.c_str()),
+ _("Ok"));
dialog.runModal();
_musicType = MDT_ADLIB;
}
View
@@ -25,6 +25,7 @@
#include "common/endian.h"
#include "common/file.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "sky/compact.h"
#include "gui/message.h"
#include <stddef.h> // for ptrdiff_t
@@ -126,8 +127,8 @@ static const uint32 turnTableOffsets[] = {
SkyCompact::SkyCompact() {
_cptFile = new Common::File();
if (!_cptFile->open("sky.cpt")) {
- GUI::MessageDialog dialog("Unable to find \"sky.cpt\" file!\n"
- "Please download it from www.scummvm.org", "OK", NULL);
+ GUI::MessageDialog dialog(_("Unable to find \"sky.cpt\" file!\n"
+ "Please download it from www.scummvm.org"), _("OK"), NULL);
dialog.runModal();
error("Unable to find \"sky.cpt\" file\nPlease download it from www.scummvm.org");
}
@@ -137,7 +138,7 @@ SkyCompact::SkyCompact() {
error("unknown \"sky.cpt\" version");
if (SKY_CPT_SIZE != _cptFile->size()) {
- GUI::MessageDialog dialog("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org", "OK", NULL);
+ GUI::MessageDialog dialog(_("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org"), _("OK"), NULL);
dialog.runModal();
error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE);
}
Oops, something went wrong.

0 comments on commit 06bbb57

Please sign in to comment.