[Scummvm-cvs-logs] SF.net SVN: scummvm:[49759] scummvm/trunk

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 12:44:51 CEST 2010


Revision: 49759
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49759&view=rev
Author:   sev
Date:     2010-06-15 10:44:51 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Implement translation support for ScummVM GUI.

Based on patch #2903830: "Updated Translation Prototype" by alexbevi
which in turn is based on patch #1739965 by jvprat.

Currently it builds all translations right into ScummVM. Once the
feature will be accepted more widely, i.e. more translations will
pop up, it will be trivial to move translation strings to external
file.

Finished translation: Russian
Unfinished translation: Hungarian

Things which are nice to do:
 - Language code -> language mapping for more user friendness
 - Specifying fonts to be used with language
 - Updating of interface language without restart. It will require
   moving of much code to reflowLayout() methods for each dialog

The .po files must be in single byte encodings. I.e. no support
for Unicode.

Modified Paths:
--------------
    scummvm/trunk/Makefile.common
    scummvm/trunk/base/main.cpp
    scummvm/trunk/common/error.cpp
    scummvm/trunk/common/module.mk
    scummvm/trunk/configure
    scummvm/trunk/engines/dialogs.cpp
    scummvm/trunk/gui/GuiManager.cpp
    scummvm/trunk/gui/GuiManager.h
    scummvm/trunk/gui/KeysDialog.cpp
    scummvm/trunk/gui/ThemeEngine.cpp
    scummvm/trunk/gui/about.cpp
    scummvm/trunk/gui/browser.cpp
    scummvm/trunk/gui/error.cpp
    scummvm/trunk/gui/launcher.cpp
    scummvm/trunk/gui/massadd.cpp
    scummvm/trunk/gui/options.cpp
    scummvm/trunk/gui/options.h
    scummvm/trunk/gui/saveload.cpp
    scummvm/trunk/gui/themebrowser.cpp
    scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
    scummvm/trunk/gui/themes/scummclassic.zip
    scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
    scummvm/trunk/gui/themes/scummmodern.zip
    scummvm/trunk/sound/mididrv.cpp
    scummvm/trunk/tools/module.mk

Added Paths:
-----------
    scummvm/trunk/common/messages.cpp
    scummvm/trunk/common/translation.cpp
    scummvm/trunk/common/translation.h
    scummvm/trunk/po/
    scummvm/trunk/po/POTFILES
    scummvm/trunk/po/hu_HU.po
    scummvm/trunk/po/module.mk
    scummvm/trunk/po/remove-potcdate.sed
    scummvm/trunk/po/ru_RU.po
    scummvm/trunk/po/scummvm.pot
    scummvm/trunk/tools/po2c

Modified: scummvm/trunk/Makefile.common
===================================================================
--- scummvm/trunk/Makefile.common	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/Makefile.common	2010-06-15 10:44:51 UTC (rev 49759)
@@ -28,6 +28,7 @@
 	engines \
 	graphics \
 	common \
+	po
 
 ifdef USE_MT32EMU
 MODULES += sound/softsynth/mt32

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/base/main.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -47,6 +47,7 @@
 #include "common/fs.h"
 #include "common/system.h"
 #include "common/tokenizer.h"
+#include "common/translation.h"
 
 #include "gui/GuiManager.h"
 #include "gui/message.h"
@@ -101,20 +102,20 @@
 	ConfMan.set("gameid", gameid);
 
 	// Query the plugins and find one that will handle the specified gameid
-	printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
-	printf("  Looking for a plugin supporting this gameid... ");
+	printf(_t("User picked target '%s' (gameid '%s')...\n"), ConfMan.getActiveDomainName().c_str(), gameid.c_str());
+	printf(_t("  Looking for a plugin supporting this gameid... "));
 	GameDescriptor game = EngineMan.findGame(gameid, &plugin);
 
 	if (plugin == 0) {
-		printf("failed\n");
-		warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
+		printf(_t("failed\n"));
+		warning(_t("%s is an invalid gameid. Use the --list-games option to list supported gameid"), gameid.c_str());
 		return 0;
 	} else {
 		printf("%s\n", plugin->getName());
 	}
 
 	// FIXME: Do we really need this one?
-	printf("  Starting '%s'\n", game.description().c_str());
+	printf(_t("  Starting '%s'\n"), game.description().c_str());
 
 	return plugin;
 }
@@ -141,9 +142,9 @@
 		// Is a separate dialog here still required?
 
 		//GUI::displayErrorDialog("ScummVM could not find any game in the specified directory!");
-		const char *errMsg = Common::errorToString(err);
+		const char *errMsg = _(Common::errorToString(err));
 
-		warning("%s failed to instantiate engine: %s (target '%s', path '%s')",
+		warning(_t("%s failed to instantiate engine: %s (target '%s', path '%s')"),
 			plugin->getName(),
 			errMsg,
 			ConfMan.getActiveDomainName().c_str(),
@@ -200,7 +201,7 @@
 	while (!tokenizer.empty()) {
 		Common::String token = tokenizer.nextToken();
 		if (!DebugMan.enableDebugChannel(token))
-			warning("Engine does not support debug level '%s'", token.c_str());
+			warning(_("Engine does not support debug level '%s'"), token.c_str());
 	}
 
 	// Inform backend that the engine is about to be run
@@ -268,22 +269,22 @@
 	mapper->registerHardwareKeySet(keySet);
 
 	// Now create the global keymap
-	act = new Action(globalMap, "MENU", "Menu", kGenericActionType, kSelectKeyType);
+	act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType);
 	act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0));
 
-	act = new Action(globalMap, "SKCT", "Skip", kGenericActionType, kActionKeyType);
+	act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType);
 	act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));
 
-	act = new Action(globalMap, "PAUS", "Pause", kGenericActionType, kStartKeyType);
+	act = new Action(globalMap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType);
 	act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0));
 
-	act = new Action(globalMap, "SKLI", "Skip line", kGenericActionType, kActionKeyType);
+	act = new Action(globalMap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType);
 	act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0));
 
-	act = new Action(globalMap, "VIRT", "Display keyboard", kVirtualKeyboardActionType);
+	act = new Action(globalMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType);
 	act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0));
 
-	act = new Action(globalMap, "REMP", "Remap keys", kKeyRemapActionType);
+	act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType);
 	act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0));
 
 	mapper->addGlobalKeymap(globalMap);
@@ -319,6 +320,8 @@
 	// Update the config file
 	ConfMan.set("versioninfo", gScummVMVersion, Common::ConfigManager::kApplicationDomain);
 
+	// Enable translation
+	TransMan.setLanguage(ConfMan.get("gui_language").c_str());
 
 	// Load and setup the debuglevel and the debug flags. We do this at the
 	// soonest possible moment to ensure debug output starts early on, if
@@ -387,7 +390,7 @@
 			// Did an error occur ?
 			if (result != Common::kNoError) {
 				// Shows an informative error dialog if starting the selected game failed.
-				GUI::displayErrorDialog(result, "Error running game:");
+				GUI::displayErrorDialog(result, _("Error running game:"));
 			}
 
 			// Quit unless an error occurred, or Return to launcher was requested
@@ -413,8 +416,8 @@
 		} else {
 			// A dialog would be nicer, but we don't have any
 			// screen to draw on yet.
-			warning("Could not find any engine capable of running the selected game");
-			GUI::displayErrorDialog("Could not find any engine capable of running the selected game");
+			warning(_("Could not find any engine capable of running the selected game"));
+			GUI::displayErrorDialog(_("Could not find any engine capable of running the selected game"));
 		}
 
 		// We will destroy the AudioCDManager singleton here to save some memory.

Modified: scummvm/trunk/common/error.cpp
===================================================================
--- scummvm/trunk/common/error.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/common/error.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -26,6 +26,8 @@
 #include "common/error.h"
 #include "common/util.h"
 
+#include "common/translation.h"
+
 namespace Common {
 
 /**
@@ -38,24 +40,24 @@
 };
 
 static const ErrorMessage _errMsgTable[] = {
-	{ kInvalidPathError, "Invalid Path" },
-	{ kNoGameDataFoundError, "Game Data not found" },
-	{ kUnsupportedGameidError, "Game Id not supported" },
-	{ kUnsupportedColorMode, "Unsupported Color Mode" },
+	{ kInvalidPathError, _s("Invalid Path") },
+	{ kNoGameDataFoundError, _s("Game Data not found") },
+	{ kUnsupportedGameidError, _s("Game Id not supported") },
+	{ kUnsupportedColorMode, _s("Unsupported Color Mode") },
 
-	{ kReadPermissionDenied, "Read permission denied" },
-	{ kWritePermissionDenied, "Write permission denied" },
+	{ kReadPermissionDenied, _s("Read permission denied") },
+	{ kWritePermissionDenied, _s("Write permission denied") },
 
 	// The following three overlap a bit with kInvalidPathError and each other. Which to keep?
-	{ kPathDoesNotExist, "Path not exists" },
-	{ kPathNotDirectory, "Path not a directory" },
-	{ kPathNotFile, "Path not a file" },
+	{ kPathDoesNotExist, _s("Path not exists") },
+	{ kPathNotDirectory, _s("Path not a directory") },
+	{ kPathNotFile, _s("Path not a file") },
 
-	{ kCreatingFileFailed, "Cannot create file" },
-	{ kReadingFailed, "Reading failed" },
-	{ kWritingFailed, "Writing data failed" },
+	{ kCreatingFileFailed, _s("Cannot create file") },
+	{ kReadingFailed, _s("Reading failed") },
+	{ kWritingFailed, _s("Writing data failed") },
 
-	{ kUnknownError, "Unknown Error" }
+	{ kUnknownError, _s("Unknown Error") }
 };
 
 const char *errorToString(Error error) {
@@ -66,7 +68,7 @@
 		}
 	}
 
-	return "Unknown Error";
+	return _("Unknown Error");
 }
 
 } // End of namespace Common

Added: scummvm/trunk/common/messages.cpp
===================================================================
--- scummvm/trunk/common/messages.cpp	                        (rev 0)
+++ scummvm/trunk/common/messages.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -0,0 +1,543 @@
+/* generated by po2c 1.0.2 - Do not modify */
+
+#include <stdio.h>
+#include <string.h>
+
+static const char * _po2c_msgids[] = {
+	/* 0 */ "",
+	/* 1 */ "  Looking for a plugin supporting this gameid... ",
+	/* 2 */ "  Starting '%s'\n",
+	/* 3 */ "%s failed to instantiate engine: %s (target '%s', path '%s')",
+	/* 4 */ "%s is an invalid gameid. Use the --list-games option to list supported gameid",
+	/* 5 */ "... progress ...",
+	/* 6 */ "11kHz",
+	/* 7 */ "22 kHz",
+	/* 8 */ "44 kHz",
+	/* 9 */ "48 kHz",
+	/* 10 */ "8 kHz",
+	/* 11 */ "<default>",
+	/* 12 */ "ALSA",
+	/* 13 */ "About",
+	/* 14 */ "About...",
+	/* 15 */ "AdLib",
+	/* 16 */ "AdLib emulator:",
+	/* 17 */ "Add Game...",
+	/* 18 */ "Angol",
+	/* 19 */ "Antialiased Renderer (16bpp)",
+	/* 20 */ "Aspect ratio correction",
+	/* 21 */ "Associated key : %s",
+	/* 22 */ "Associated key : none",
+	/* 23 */ "Atari ST MIDI",
+	/* 24 */ "Audio",
+	/* 25 */ "Autosave:",
+	/* 26 */ "C1Available engines:",
+	/* 27 */ "C1Features compiled in:",
+	/* 28 */ "C2(built on ",
+	/* 29 */ "CAMD",
+	/* 30 */ "Cancel",
+	/* 31 */ "Cannot create file",
+	/* 32 */ "Choose",
+	/* 33 */ "Choose an action to map",
+	/* 34 */ "Close",
+	/* 35 */ "CoreAudio",
+	/* 36 */ "CoreMIDI",
+	/* 37 */ "Could not find any engine capable of running the selected game",
+	/* 38 */ "Creative Music System",
+	/* 39 */ "DMedia",
+	/* 40 */ "Date: ",
+	/* 41 */ "Default",
+	/* 42 */ "Delete",
+	/* 43 */ "Disabled GFX",
+	/* 44 */ "Discovered %d new games ...",
+	/* 45 */ "Discovered %d new games.",
+	/* 46 */ "Display keyboard",
+	/* 47 */ "Do you really want to delete this savegame?",
+	/* 48 */ "Do you really want to remove this game configuration?",
+	/* 49 */ "Do you really want to run the mass game detector? This could potentially add a huge number of games.",
+	/* 50 */ "Edit Game...",
+	/* 51 */ "Enable Roland GS Mode",
+	/* 52 */ "Engine does not support debug level '%s'",
+	/* 53 */ "English",
+	/* 54 */ "Error running game:",
+	/* 55 */ "Extra Path:",
+	/* 56 */ "FM Towns",
+	/* 57 */ "Failed to load any GUI theme, aborting",
+	/* 58 */ "FluidSynth",
+	/* 59 */ "Fullscreen mode",
+	/* 60 */ "GFX",
+	/* 61 */ "GUI Renderer:",
+	/* 62 */ "Game",
+	/* 63 */ "Game Data not found",
+	/* 64 */ "Game Id not supported",
+	/* 65 */ "Game Path:",
+	/* 66 */ "Go up",
+	/* 67 */ "Graphics",
+	/* 68 */ "Graphics mode:",
+	/* 69 */ "Help",
+	/* 70 */ "IBM PCjr",
+	/* 71 */ "ID:",
+	/* 72 */ "Invalid Path",
+	/* 73 */ "Invalid game path",
+	/* 74 */ "Keys",
+	/* 75 */ "Language:",
+	/* 76 */ "Load",
+	/* 77 */ "Load game:",
+	/* 78 */ "Load...",
+	/* 79 */ "MIDI",
+	/* 80 */ "MIDI gain:",
+	/* 81 */ "MT-32 Emulation",
+	/* 82 */ "Map",
+	/* 83 */ "Mass Add...",
+	/* 84 */ "Menu",
+	/* 85 */ "Misc",
+	/* 86 */ "Mixed AdLib/MIDI mode",
+	/* 87 */ "Mouse click",
+	/* 88 */ "Music driver:",
+	/* 89 */ "Music volume:",
+	/* 90 */ "Mute All",
+	/* 91 */ "Name:",
+	/* 92 */ "Never",
+	/* 93 */ "No",
+	/* 94 */ "No date saved",
+	/* 95 */ "No music",
+	/* 96 */ "No playtime saved",
+	/* 97 */ "No time saved",
+	/* 98 */ "None",
+	/* 99 */ "OK",
+	/* 100 */ "Options",
+	/* 101 */ "Options...",
+	/* 102 */ "Output rate:",
+	/* 103 */ "Override global MIDI settings",
+	/* 104 */ "Override global audio settings",
+	/* 105 */ "Override global graphic settings",
+	/* 106 */ "Override global volume settings",
+	/* 107 */ "PC Speaker",
+	/* 108 */ "Path not a directory",
+	/* 109 */ "Path not a file",
+	/* 110 */ "Path not exists",
+	/* 111 */ "Paths",
+	/* 112 */ "Pause",
+	/* 113 */ "Pick the game:",
+	/* 114 */ "Platform:",
+	/* 115 */ "Playtime: ",
+	/* 116 */ "Please select an action",
+	/* 117 */ "Plugins Path:",
+	/* 118 */ "Press the key to associate",
+	/* 119 */ "Quit",
+	/* 120 */ "Read permission denied",
+	/* 121 */ "Reading failed",
+	/* 122 */ "Remap keys",
+	/* 123 */ "Remove Game",
+	/* 124 */ "Render mode:",
+	/* 125 */ "Resume",
+	/* 126 */ "Return to Launcher",
+	/* 127 */ "SEQ",
+	/* 128 */ "SFX volume:",
+	/* 129 */ "Save",
+	/* 130 */ "Save Path:",
+	/* 131 */ "Save Path: ",
+	/* 132 */ "Save game:",
+	/* 133 */ "Scan complete!",
+	/* 134 */ "Scanned %d directories ...",
+	/* 135 */ "ScummVM could not find any engine capable of running the selected game!",
+	/* 136 */ "ScummVM could not find any game in the specified directory!",
+	/* 137 */ "ScummVM couldn't open the specified directory!",
+	/* 138 */ "Search:",
+	/* 139 */ "Select SoundFont",
+	/* 140 */ "Select a Theme",
+	/* 141 */ "Select additional game directory",
+	/* 142 */ "Select an action and click 'Map'",
+	/* 143 */ "Select directory for GUI themes",
+	/* 144 */ "Select directory for extra files",
+	/* 145 */ "Select directory for plugins",
+	/* 146 */ "Select directory for saved games",
+	/* 147 */ "Select directory for savegames",
+	/* 148 */ "Select directory with game data",
+	/* 149 */ "Skip",
+	/* 150 */ "Skip line",
+	/* 151 */ "SoundFont:",
+	/* 152 */ "Speech & Subs",
+	/* 153 */ "Speech Only",
+	/* 154 */ "Speech and Subtitles",
+	/* 155 */ "Speech volume:",
+	/* 156 */ "Standard Renderer (16bpp)",
+	/* 157 */ "Start",
+	/* 158 */ "Subtitle speed:",
+	/* 159 */ "Subtitles Only",
+	/* 160 */ "Szak\xEDtani",
+	/* 161 */ "Tapwave Zodiac",
+	/* 162 */ "Text and Speech:",
+	/* 163 */ "The chosen directory cannot be written to. Please select another one.",
+	/* 164 */ "Theme Path:",
+	/* 165 */ "Theme:",
+	/* 166 */ "This game ID is already taken. Please choose another one.",
+	/* 167 */ "This game does not support loading games from the launcher.",
+	/* 168 */ "TiMidity",
+	/* 169 */ "Time: ",
+	/* 170 */ "True Roland MT-32 (disable GM emulation)",
+	/* 171 */ "Unable to locate game data",
+	/* 172 */ "Unknown Error",
+	/* 173 */ "Unknown error",
+	/* 174 */ "Unsupported Color Mode",
+	/* 175 */ "Untitled savestate",
+	/* 176 */ "User picked target '%s' (gameid '%s')...\n",
+	/* 177 */ "Volume",
+	/* 178 */ "Windows MIDI",
+	/* 179 */ "Write permission denied",
+	/* 180 */ "Writing data failed",
+	/* 181 */ "Wrong configuration: Both subtitles and speech are off. Assuming subtitles only",
+	/* 182 */ "Yamaha Pa1",
+	/* 183 */ "Yes",
+	/* 184 */ "You have to restart ScummVM to take the effect.",
+	/* 185 */ "every 10 mins",
+	/* 186 */ "every 15 mins",
+	/* 187 */ "every 30 mins",
+	/* 188 */ "every 5 mins",
+	/* 189 */ "failed\n",
+	NULL
+};
+
+struct _po2c_msg {
+	int msgid;
+	const char * msgstr;
+};
+
+static struct _po2c_msg _po2c_lang_ru_RU[] = {
+	{ 0, "Project-Id-Version: ScummVM VERSION\nReport-Msgid-Bugs-To: scummvm-devel at lists.sf.net\nPOT-Creation-Date: 2010-06-08 17:25+0300\nPO-Revision-Date: 2010-06-08 08:52-0100\nLast-Translator: Eugene Sandulenko <sev at scummvm.org>\nLanguage-Team: Russian\nMIME-Version: 1.0\nContent-Type: text/plain; charset=cp1251\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=3;     plural=n%10==1 && n%100!=11 ? 0 :            n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" },
+	{ 1, "  \310\371\363 \357\353\340\343\350\355 \361 \357\356\344\344\345\360\346\352\356\351 \375\362\356\343\356 gameid... " },
+	{ 2, "  \307\340\357\363\361\352\340\376 '%s'\n" },
+	{ 3, "%s \355\345 \361\354\356\343 \347\340\357\363\361\362\350\362\374 \344\342\350\346\356\352: %s (\366\345\353\374 '%s', \357\363\362\374 '%s')" },
+	{ 4, "\315\345\342\345\360\355\373\351 gameid %s. \310\361\357\356\353\374\347\363\351\362\345 \356\357\366\350\376 --list-games \344\353\377 \357\360\356\361\354\356\362\360\340 \361\357\350\361\352\340 \357\356\344\344\345\360\346\350\342\340\345\354\373\365 gameid" },
+	{ 5, "... \350\371\363 ..." },
+	{ 6, "11 \352\303\366" },
+	{ 7, "22 \352\303\366" },
+	{ 8, "44 \352\303\366" },
+	{ 9, "48 \352\303\366" },
+	{ 10, "8 \352\303\366" },
+	{ 11, "<\357\356 \363\354\356\353\367\340\355\350\376>" },
+	{ 12, "ALSA" },
+	{ 13, "\316 \357\360\356\343\360\340\354\354\345" },
+	{ 14, "\316 \357\360\356\343\360\340\354\354\345..." },
+	{ 15, "AdLib" },
+	{ 16, "\335\354\363\353\377\362\356\360 AdLib:" },
+	{ 17, "\315\356\342. \350\343\360\340..." },
+	{ 19, "\320\340\361\362\345\360\350\347\340\362\356\360 \361\356 \361\343\353\340\346\350\342\340\355\350\345\354 (16bpp)" },
+	{ 20, "\312\356\360\360\345\352\366\350\377 \361\356\356\362\355\356\370\345\355\350\377 \361\362\356\360\356\355" },
+	{ 21, "\315\340\347\355\340\367\345\355\355\340\377 \352\353\340\342\350\370\340 : %s" },
+	{ 22, "\315\340\347\355\340\367\345\355\355\340\377 \352\353\340\342\350\370\340 : \355\345\362" },
+	{ 23, "Atars ST MIDI" },
+	{ 24, "\300\363\344\350\356" },
+	{ 25, "\300\342\362\356\361\356\365\360\340\355\345\355\350\345:" },
+	{ 26, "C1\304\356\361\362\363\357\355\373\345 \344\342\350\346\352\350:" },
+	{ 27, "C1\302\352\353\376\367\345\355\355\373\345 \342 \341\350\353\344 \356\357\366\350\350:" },
+	{ 28, "C2(\361\356\341\360\340\355 " },
+	{ 29, "CAMD" },
+	{ 30, "\316\362\354\345\355\340" },
+	{ 31, "\315\345 \354\356\343\363 \361\356\347\344\340\362\374 \364\340\351\353" },
+	{ 32, "\302\373\341\360\340\362\374" },
+	{ 33, "\302\373\341\345\360\350\362\345 \344\345\351\361\362\342\350\345 \344\353\377 \355\340\347\355\340\367\345\355\350\377" },
+	{ 34, "\307\340\352\360\373\362\374" },
+	{ 35, "CoreAudio" },
+	{ 36, "CoreMIDI" },
+	{ 37, "\315\345 \354\356\343\363 \355\340\351\362\350 \344\342\350\346\356\352 \344\353\377 \347\340\357\363\361\352\340 \342\373\341\360\340\355\355\356\351 \350\343\360\373" },
+	{ 38, "Creative Music System" },
+	{ 39, "DMedia" },
+	{ 40, "\304\340\362\340: " },
+	{ 41, "\317\356 \363\354\356\353\367\340\355\350\376" },
+	{ 42, "\323\344\340\353\350\362\374" },
+	{ 43, "\301\345\347 \343\360\340\364\350\352\350" },
+	{ 44, "\315\340\351\344\345\355\356 %d \355\356\342\373\365 \350\343\360 ..." },
+	{ 45, "\315\340\351\344\345\355\356 %d \355\356\342\373\365 \350\343\360." },
+	{ 46, "\317\356\352\340\347\340\362\374 \352\353\340\342\350\340\362\363\360\363" },
+	{ 47, "\302\373 \344\345\351\361\362\342\350\362\345\353\374\355\356 \365\356\362\350\362\345 \363\344\340\353\350\362\374 \375\362\356 \361\356\365\360\340\355\345\355\350\345?" },
+	{ 48, "\302\373 \344\345\351\361\362\342\350\362\345\353\374\355\356 \365\356\362\350\362\345 \363\344\340\353\350\362\374 \363\361\362\340\355\356\342\352\350 \344\353\377 \375\362\356\351 \350\343\360\373?" },
+	{ 49, "\302\373 \344\345\351\361\362\342\350\362\345\353\374\355\356 \365\356\362\350\362\345 \347\340\357\363\361\362\350\362\374 \344\345\362\345\352\362\356\360 \342\361\345\365 \350\343\360? \335\362\356 \357\356\362\345\355\366\350\340\353\374\355\356 \354\356\346\345\362 \344\356\341\340\342\350\362\374 \341\356\353\374\370\356\345 \352\356\353\350\367\345\361\362\342\356 \350\343\360." },
+	{ 50, "\310\347\354. \350\343\360\363..." },
+	{ 51, "\302\352\353\376\367\350\362\374 \360\345\346\350\354 Roland GS" },
+	{ 52, "\304\342\350\346\356\352 \355\345 \357\356\344\344\345\360\346\350\342\340\345\362 \363\360\356\342\345\355\374 \356\362\353\340\344\352\350 '%s'" },
+	{ 53, "English" },
+	{ 54, "\316\370\350\341\352\340 \347\340\357\363\361\352\340 \350\343\360\373:" },
+	{ 55, "\304\356\357. \357\363\362\374:" },
+	{ 56, "FM Towns" },
+	{ 57, "\315\345 \363\344\340\353\356\361\374 \347\340\343\360\363\347\350\362\374 \362\345\354\363 GUI, \357\360\345\352\360\340\371\340\376 \360\340\341\356\362\363" },
+	{ 58, "FluidSynth" },
+	{ 59, "\317\356\353\355\356\375\352\360\340\355\355\373\351 \360\345\346\350\354" },
+	{ 60, "\303\360\364" },
+	{ 61, "\320\340\361\362\345\360\350\347\340\362\356\360 GUI:" },
+	{ 62, "\310\343\360\340" },
+	{ 63, "\315\345\362 \364\340\351\353\356\342 \350\343\360\373" },
+	{ 64, "Game Id \355\345 \357\356\344\344\345\360\346\350\342\340\345\362\361\377" },
+	{ 65, "\317\363\362\374 \352 \350\343\360\345: " },
+	{ 66, "\302\342\345\360\365" },
+	{ 67, "\303\360\340\364\350\352\340" },
+	{ 68, "\303\360\340\364\350\367\345\361\352\350\351 \360\345\346\350\354:" },
+	{ 69, "\317\356\354\356\371\374" },
+	{ 70, "IBM PCjr" },
+	{ 71, "ID:" },
+	{ 72, "\315\345\342\345\360\355\373\351 \357\363\362\374" },
+	{ 74, "\312\353\340\342\350\370\350" },
+	{ 75, "\337\347\373\352:" },
+	{ 76, "\307\340\343\360\363\347\350\362\374" },
+	{ 77, "\307\340\343\360\363\347\350\362\374 \350\343\360\363:" },
+	{ 78, "\307\340\343\360...." },
+	{ 79, "MIDI" },
+	{ 80, "\323\361\350\353\345\355\350\345 MIDI:" },
+	{ 81, "\335\354\363\353\377\366\350\377 MT-32" },
+	{ 82, "\315\340\347\355\340\367\350\362\374" },
+	{ 83, "\304\356\341. \354\355\356\343\356..." },
+	{ 84, "\314\345\355\376" },
+	{ 85, "\320\340\347\355\356\345" },
+	{ 86, "\321\354\345\370\340\355\355\373\351 \360\345\346\350\354 AdLib/MIDI" },
+	{ 87, "\312\353\350\352 \354\373\370\374\376" },
+	{ 88, "\304\360\340\351\342\345\360 \354\363\347\373\352\350:" },
+	{ 89, "\303\360\356\354\352\356\361\362\374 \354\363\347\373\352\350:" },
+	{ 90, "\302\373\352\353\376\367\350\362\374 \342\361\270" },
+	{ 91, "\315\340\347\342\340\355\350\345:" },
+	{ 92, "\315\350\352\356\343\344\340" },
+	{ 93, "\315\345\362" },
+	{ 94, "\304\340\362\340 \355\345 \347\340\357\350\361\340\355\340" },
+	{ 95, "\301\345\347 \354\363\347\373\352\350" },
+	{ 96, "\302\360\345\354\377 \350\343\360\373 \355\345 \347\340\357\350\361\340\355\356" },
+	{ 97, "\302\360\345\354\377 \355\345 \347\340\357\350\361\340\355\356" },
+	{ 98, "\315\345 \347\340\344\340\355" },
+	{ 99, "OK" },
+	{ 100, "\316\357\366\350\350" },
+	{ 101, "\316\357\366\350\350..." },
+	{ 102, "\302\373\365\356\344\355\340\377 \367\340\361\362\356\362\340:" },
+	{ 103, "\317\345\360\345\352\360\373\362\374 \343\353\356\341\340\353\374\355\373\345 \363\361\362\340\355\356\342\352\350 MIDI" },
+	{ 104, "\317\345\360\345\352\360\373\362\374 \343\353\356\341\340\353\374\355\373\345 \363\361\362\340\355\356\342\352\350 \340\363\344\350\356" },
+	{ 105, "\317\345\360\345\352\360\373\362\374 \343\353\356\341\340\353\374\355\373\345 \363\361\362\340\355\356\342\352\350 \343\360\340\364\350\352\350" },
+	{ 106, "\317\345\360\345\352\360\373\362\374 \343\353\356\341\340\353\374\355\373\345 \363\361\362\340\355\356\342\352\350 \343\360\356\354\352\356\361\362\350" },
+	{ 107, "PC \361\357\350\352\345\360" },
+	{ 108, "\317\363\362\374 \355\345 \377\342\353\377\345\362\361\377 \344\350\360\345\352\362\356\360\350\345\351" },
+	{ 109, "\317\363\362\374 \355\345 \377\342\353\377\345\362\361\377 \364\340\351\353\356\354" },
+	{ 110, "\317\363\362\374 \355\345 \355\340\351\344\345\355" },
+	{ 111, "\317\363\362\350" },
+	{ 112, "\317\340\363\347\340" },
+	{ 113, "\302\373\341\345\360\350\362\345 \350\343\360\363:" },
+	{ 114, "\317\353\340\362\364\356\360\354\340:" },
+	{ 115, "\302\360\345\354\377 \350\343\360\373: " },
+	{ 116, "\317\356\346\340\353\363\351\361\362\340, \342\373\341\345\360\350\362\345 \344\345\351\361\362\342\350\345" },
+	{ 117, "\317\363\362\374 \352 \357\353\340\343\350\355\340\354:" },
+	{ 118, "\315\340\346\354\350\362\345 \352\353\340\342\350\370\363 \344\353\377 \355\340\347\355\340\367\345\355\350\377" },
+	{ 119, "\302\373\365\356\344" },
+	{ 120, "\315\345\344\356\361\362\340\362\356\367\355\356 \357\360\340\342 \344\353\377 \367\362\345\355\350\377" },
+	{ 121, "\316\370\350\341\352\340 \367\362\345\355\350\377" },
+	{ 122, "\317\345\360\345\355\340\347\355\340\367\350\362\374 \352\353\340\342\350\370\350" },
+	{ 123, "\323\344\340\353\350\362\374 \350\343\360\363" },
+	{ 124, "\320\345\346\350\354 \360\340\361\362\360\350\360\356\342\340\355\350\377:" },
+	{ 125, "\317\360\356\344\356\353\346\350\362\374" },
+	{ 126, "\302\345\360\355\363\362\374\361\377 \342 \343\353\340\342\355\356\345 \354\345\355\376" },
+	{ 127, "SEQ" },
+	{ 128, "\303\360\356\354\352\356\361\362\374 \375\364\364\345\352\362\356\342:" },
+	{ 129, "\307\340\357\350\361\340\362\374" },
+	{ 130, "\317\363\362\374 \361\356\365\360.: " },
+	{ 131, "\317\363\362\374 \344\353\377 \361\356\365\360\340\355\345\355\350\351: " },
+	{ 132, "\321\356\365\360\340\355\350\362\374 \350\343\360\363: " },
+	{ 133, "\317\356\350\361\352 \347\340\352\356\355\367\345\355!" },
+	{ 134, "\317\360\356\361\354\356\362\360\345\355\356 %d \344\350\360\345\352\362\356\360\350\351 ..." },
+	{ 135, "ScummVM \355\345 \361\354\356\343 \355\340\351\362\350 \344\342\350\346\356\352 \344\353\377 \347\340\357\363\361\352\340 \342\373\341\360\340\355\355\356\351 \350\343\360\373!" },
+	{ 136, "ScummVM \355\345 \354\356\346\345\362 \355\340\351\362\350 \350\343\360\363 \342 \363\352\340\347\340\355\355\356\351 \344\350\360\345\352\362\356\360\350\350!" },
+	{ 137, "ScummVM \355\345 \354\356\346\345\362 \356\362\352\360\373\362\374 \363\352\340\347\340\355\355\363\376 \344\350\360\345\352\362\356\360\350\376!" },
+	{ 138, "\317\356\350\361\352:" },
+	{ 139, "\302\373\341\345\360\350\362\345 SoundFont" },
+	{ 140, "\302\373\341\345\360\350\362\345 \362\345\354\363" },
+	{ 141, "\302\373\341\345\360\350\362\345 \344\356\357\356\353\355\350\362\345\353\374\355\363\376 \344\350\360\345\352\362\356\360\350\376 \350\343\360\373" },
+	{ 142, "\302\373\341\345\360\350\362\345 \344\345\351\361\362\342\350\345 \350 \352\353\350\352\355\350\362\345 '\315\340\347\355\340\367\350\362\374'" },
+	{ 143, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \344\353\377 \362\345\354 GUI" },
+	{ 144, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \361 \344\356\357\356\353\355\350\362\345\353\374\355\373\354\350 \364\340\351\353\340\354\350" },
+	{ 145, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \361 \357\353\340\343\350\355\340\354\350" },
+	{ 146, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \344\353\377 \361\356\365\360\340\355\345\355\350\351" },
+	{ 147, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \344\353\377 \361\356\365\360\340\355\345\355\350\351" },
+	{ 148, "\302\373\341\345\360\350\362\345 \344\350\360\345\352\362\356\360\350\376 \361 \364\340\351\353\340\354\350 \350\343\360\373" },
+	{ 149, "\317\360\356\357\363\361\362\350\362\374" },
+	{ 150, "\317\360\356\357\363\361\362\350\362\374 \361\362\360\356\352\363" },
+	{ 151, "SoundFont:" },
+	{ 152, "\307\342\363\352 \350 \361\363\341." },
+	{ 153, "\322\356\353\374\352\356 \356\347\342\363\367\352\340" },
+	{ 154, "\316\347\342\363\367\352\340 \350 \361\363\341\362\350\362\360\373" },
+	{ 155, "\303\360\356\354\352\356\361\362\374 \356\347\342\363\367\352\350:" },
+	{ 156, "\321\362\340\355\344\340\360\362\355\373\351 \360\340\361\362\345\360\350\347\340\362\356\360 (16bpp)" },
+	{ 157, "\317\363\361\352" },
+	{ 158, "\321\352\356\360\356\361\362\374 \361\363\341\362\350\362\360\356\342:" },
+	{ 159, "\322\356\353\374\352\356 \361\363\341\362\350\362\360\373" },
+	{ 161, "Tapware Zodiac" },
+	{ 162, "\322\345\352\361\362 \350 \356\347\342\363\367\352\340:" },
+	{ 163, "\315\345 \354\356\343\363 \357\350\361\340\362\374 \342 \342\373\341\360\340\355\355\363\376 \344\350\360\345\352\362\356\360\350\376. \317\356\346\340\353\363\351\361\362\340, \363\352\340\346\350\362\345 \344\360\363\343\363\376." },
+	{ 164, "\317\363\362\374 \352 \362\345\354\340\354:" },
+	{ 165, "\322\345\354\340:" },
+	{ 166, "\335\362\356\362 ID \350\343\360\373 \363\346\345 \350\361\357\356\353\374\347\363\345\362\361\377. \317\356\346\340\353\363\351\361\362\340, \342\373\341\345\360\350\362\345 \344\360\363\343\356\351." },
+	{ 167, "\335\362\340 \350\343\360\340 \355\345 \357\356\344\344\345\360\346\350\342\340\345\362 \347\340\343\360\363\347\352\363 \361\356\365\360\340\355\345\355\350\351 \367\345\360\345\347 \343\353\340\342\355\356\345 \354\345\355\376." },
+	{ 168, "TiMidity" },
+	{ 169, "\302\360\345\354\377: " },
+	{ 170, "\315\340\361\362\356\377\371\350\351 Roland MT-32 (\347\340\357\360\345\362\350\362\374 \375\354\363\353\377\366\350\376 GM)" },
+	{ 172, "\315\345\350\347\342\345\361\362\355\340\377 \356\370\350\341\352\340" },
+	{ 174, "\315\345\357\356\344\344\345\360\346\350\342\340\345\354\373\351 \360\345\346\350\354 \366\342\345\362\340" },
+	{ 175, "\321\356\365\360\340\355\345\355\350\345 \341\345\347 \350\354\345\355\350" },
+	{ 176, "\317\356\353\374\347\356\342\340\362\345\353\374 \342\373\341\360\340\353 \366\345\353\374'%s' (gameid '%s')...\n" },
+	{ 177, "\303\360\356\354\352\356\361\362\374" },
+	{ 178, "Windows MIDI" },
+	{ 179, "\315\345\344\356\361\362\340\362\356\367\355\356 \357\360\340\342 \344\353\377 \347\340\357\350\361\350" },
+	{ 180, "\316\370\350\341\352\340 \347\340\357\350\361\350 \344\340\355\355\373\365" },
+	{ 182, "Yamaha Pa1" },
+	{ 183, "\304\340" },
+	{ 184, "\302\373 \344\356\353\346\355\373 \357\345\360\345\347\340\357\363\361\362\350\362\374 ScummVM \367\362\356\341\373 \357\360\350\354\345\355\350\362\374 \350\347\354\345\355\345\355\350\377." },
+	{ 185, "\352\340\346\344\373\345 10 \354\350\355\363\362" },
+	{ 186, "\352\340\346\344\373\345 15 \354\350\355\363\362" },
+	{ 187, "\352\340\346\344\373\345 30 \354\350\355\363\362" },
+	{ 188, "\352\340\346\344\373\345 5 \354\350\355\363\362" },
+	{ 189, "\355\345 \363\344\340\353\356\361\374\n" },
+	{ -1, NULL }
+};
+
+static struct _po2c_msg _po2c_lang_hu_HU[] = {
+	{ 0, "Project-Id-Version: ScummVM VERSION\nReport-Msgid-Bugs-To: scummvm-devel at lists.sourceforge.net\nPOT-Creation-Date: 2009-11-25 07:10-0500\nPO-Revision-Date: 2009-11-25 07:42-0500\nLast-Translator: Alex Bevilacqua <alexbevi at gmail.com>\nLanguage-Team: Hungarian\nMIME-Version: 1.0\nContent-Type: text/plain; charset=ASCII\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=2; plural=(n != 1);\n" },
+	{ 11, "<alap\351rtelmezett>" },
+	{ 16, "AdLib vezet :" },
+	{ 20, "Aspect adag korrekci\363" },
+	{ 24, "Hang" },
+	{ 25, "Automatikus ment\351s:" },
+	{ 51, "K\351pess\351 Roland GS Mode" },
+	{ 55, "Extra \332tvonal:" },
+	{ 59, "Teljes k\351perny s m\363d:" },
+	{ 61, "Lek\351pez eszk\366z GUI:" },
+	{ 67, "Grafik\341val" },
+	{ 68, "Grafikus m\363d:" },
+	{ 74, "Kulcsok" },
+	{ 80, "MIDI nyeres\351g:" },
+	{ 86, "Vegyes AdLib/MIDI m\363d" },
+	{ 88, "Zenei vezet :" },
+	{ 89, "Zene mennyis\351g:" },
+	{ 90, "Muta \326sszes" },
+	{ 92, "Soha" },
+	{ 98, "Semmi" },
+	{ 99, "Igen" },
+	{ 102, "Kimeneti teljes\355tm\351ny:" },
+	{ 111, "\326sv\351nyek" },
+	{ 124, "Renderel\351si m\363d:" },
+	{ 128, "SFX mennyis\351ge" },
+	{ 152, "Besz\351d s Feliratok" },
+	{ 153, "Csak a besz\351d" },
+	{ 154, "Besz\351d \351s a Feliratok" },
+	{ 155, "Besz\351d mennyis\351g:" },
+	{ 158, "Felirat sebess\351g:" },
+	{ 159, "Csak feliratok" },
+	{ 162, "Sz\366veg \351s besz\351d:" },
+	{ 165, "T\351ma:" },
+	{ 170, "Igaz Roland MT-32 (megb\351n\355t GM emul\341ci\363)" },
+	{ 177, "Volumene" },
+	{ 185, "10 percenk\351nt" },
+	{ 186, "15 percenk\351nt" },
+	{ 187, "30 percenk\351nt" },
+	{ 188, "5 percenk\351nt" },
+	{ -1, NULL }
+};
+
+static struct {
+	const char * lang;
+	const char * charset;
+	struct _po2c_msg * msgs;
+} _po2c_langs[] = {
+	{ "ru_RU", "cp1251", _po2c_lang_ru_RU },
+	{ "hu_HU", "ASCII", _po2c_lang_hu_HU },
+	{ NULL, NULL, NULL }
+};
+
+/* code */
+
+static struct _po2c_msg * _po2c_lang=NULL;
+static int _po2c_lang_size=0;
+static const char * _po2c_charset=NULL;
+
+void po2c_setlang(const char * lang)
+{
+	int n;
+
+	_po2c_lang=NULL;
+	_po2c_lang_size=0;
+	_po2c_charset=NULL;
+
+	/* if lang is NULL or "", deactivate it */
+	if(lang == NULL || *lang == '\0')
+		return;
+
+	/* searches for a valid language array */
+	for(n=0;_po2c_lang == NULL && _po2c_langs[n].lang != NULL;n++)
+	{
+		if(strcmp(lang, _po2c_langs[n].lang) == 0) {
+			_po2c_lang=_po2c_langs[n].msgs;
+			_po2c_charset=_po2c_langs[n].charset;
+		}
+	}
+
+	/* try partial searches */
+	for(n=0;_po2c_lang == NULL && _po2c_langs[n].lang != NULL;n++)
+	{
+		if(strncmp(lang, _po2c_langs[n].lang, 2) == 0) {
+			_po2c_lang=_po2c_langs[n].msgs;
+			_po2c_charset=_po2c_langs[n].charset;
+		}
+	}
+
+	/* if found, count entries */
+	if(_po2c_lang != NULL)
+	{
+		struct _po2c_msg * m;
+
+		for(m=_po2c_lang;m->msgid != -1;m++)
+			_po2c_lang_size++;
+	}
+}
+
+const char * po2c_gettext(const char * msgid)
+{
+	struct _po2c_msg * m;
+	int b, t, n, c;
+
+	/* if no language is set or msgid is empty, return msgid as is */
+	if(_po2c_lang == NULL || *msgid == '\0')
+		return(msgid);
+
+	/* binary-search for the msgid */
+	b=0; t=_po2c_lang_size - 1;
+
+	while(t >= b)
+	{
+		n=(b + t) / 2;
+		m=&_po2c_lang[n];
+
+		c=strcmp(msgid, _po2c_msgids[m->msgid]);
+
+		if(c == 0)
+			return(m->msgstr);
+		else
+		if(c < 0)
+			t=n - 1;
+		else
+			b=n + 1;
+	}
+
+	return(msgid);
+}
+
+const char * po2c_getcharset(void)
+{
+	if (_po2c_charset)
+		return _po2c_charset;
+	else
+		return "ASCII";
+}
+
+int po2c_getnumlangs(void)
+{
+	int n = 0;
+	while (_po2c_langs[n].lang)
+		n++;
+	
+	return n;
+}
+
+const char * po2c_getlang(int num)
+{
+	return _po2c_langs[num].lang;
+}


Property changes on: scummvm/trunk/common/messages.cpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/common/module.mk
===================================================================
--- scummvm/trunk/common/module.mk	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/common/module.mk	2010-06-15 10:44:51 UTC (rev 49759)
@@ -22,11 +22,19 @@
 	system.o \
 	textconsole.o \
 	tokenizer.o \
+	translation.o \
 	unarj.o \
 	unzip.o \
 	util.o \
 	xmlparser.o \
 	zlib.o
 
+ifdef ENABLE_TRANSLATION
+common/translation.cpp: common/messages.cpp
+
+common/messages.cpp: $(wildcard po/*.po)
+	tools/po2c $^ > common/messages.cpp
+endif
+
 # Include common rules
 include $(srcdir)/rules.mk

Added: scummvm/trunk/common/translation.cpp
===================================================================
--- scummvm/trunk/common/translation.cpp	                        (rev 0)
+++ scummvm/trunk/common/translation.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -0,0 +1,221 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "translation.h"
+
+DECLARE_SINGLETON(Common::TranslationManager)
+
+#ifdef DETECTLANG
+#include <locale.h>
+#endif
+
+#ifdef TERMCONV
+#include <langinfo.h>
+#endif
+
+#ifdef TRANSLATION
+#include "messages.cpp"
+#endif
+
+namespace Common {
+
+
+#ifdef TRANSLATION
+
+// Translation enabled
+
+
+TranslationManager::TranslationManager() {
+#ifdef DETECTLANG
+	// Activating current locale settings
+	const char* locale = setlocale(LC_ALL, "");
+
+	// Detect the language from the locale
+	if (!locale) {
+		strcpy(_syslang, "C");
+	} else {
+		int len = strlen(locale);
+		if (len > 5)
+			len = 5;
+		strncpy(_syslang, locale, len);
+		_syslang[len] = 0;
+	}
+#else // DETECTLANG
+	strcpy(_syslang, "C");
+#endif // DETECTLANG
+
+#ifdef TERMCONV
+	_convmsg = NULL;
+	_conversion = NULL;
+#endif // TERMCONV
+
+	// Set the default language
+	setLanguage("");
+}
+
+TranslationManager::~TranslationManager() {
+#ifdef TERMCONV
+	iconv_close(_conversion);
+	if (_convmsg)
+		delete [] _convmsg;
+#endif // TERMCONV
+}
+
+void TranslationManager::setLanguage(const char* lang) {
+	if (*lang == '\0')
+		po2c_setlang(_syslang);
+	else
+		po2c_setlang(lang);
+
+#ifdef TERMCONV
+	// Get the locale character set (for terminal output)
+	const char* charset_term = nl_langinfo(CODESET);
+
+	// Get the messages character set
+	const char* charset_po = po2c_getcharset();
+
+	// Delete previous conversion
+	if (_conversion)
+		iconv_close(_conversion);
+
+	// Initialize the conversion
+	_conversion = iconv_open(charset_term, charset_po);
+#endif // TERMCONV
+}
+
+const char* TranslationManager::getTranslation(const char* message) {
+	return po2c_gettext(message);
+}
+
+#ifdef TERMCONV
+bool TranslationManager::convert(const char* message) {
+	// Preparing conversion origin
+	size_t len = strlen(message);
+	char* msgcpy = new char[len + 1];
+	strcpy(msgcpy, message);
+	char* msg = msgcpy;
+	char** pmsg = &msg;
+
+	// Preparing conversion destination
+	size_t len2 = _sizeconv;
+	char *conv = _convmsg;
+	char** pconv = &conv;
+
+	// Clean previous conversions
+	iconv(_conversion, NULL, NULL, pconv, &len2);
+
+	// Do the real conversion
+	size_t result = iconv(_conversion, pmsg, &len, pconv, &len2);
+
+	delete [] msgcpy;
+
+	return result != ((size_t)-1);
+}
+#endif // TERMCONV
+
+const char* TranslationManager::convertTerm(const char* message) {
+#ifdef TERMCONV
+	size_t len = strlen(message);
+	if (!_convmsg) {
+		_sizeconv = len * 2;
+		_convmsg = new char[_sizeconv];
+	}
+
+	if (!convert(message)) {
+		// Resizing the buffer
+		delete [] _convmsg;
+		_sizeconv = len * 2;
+		_convmsg = new char[_sizeconv];
+
+		if (!convert(message)) {
+			printf("Error while converting character sets\n");
+			return "Error while converting character sets";
+		}
+	}
+
+	return _convmsg;
+#else // TERMCONV
+	return message;
+#endif // TERMCONV
+}
+
+const TLangArray TranslationManager::getSupportedLanguages() const {
+	TLangArray languages;
+
+	int total = po2c_getnumlangs();
+	for (int i = 0; i < total; i++) {
+		TLanguage lng(po2c_getlang(i), i + 1);
+		languages.push_back(lng);
+	}
+
+	//sort(languages.begin(), languages.end());
+
+	return languages;
+}
+
+int TranslationManager::parseLanguage(const String lang) {
+	int total = po2c_getnumlangs();
+
+	for (int i = 0; i < total; i++) {
+		if (lang == po2c_getlang(i))
+			return i + 1;
+	}
+
+	return kTranslationBuiltinId;
+}
+
+
+const char *TranslationManager::getLangById(int id) {
+	switch (id) {
+	case kTranslationAutodetectId:
+		return "";
+	case kTranslationBuiltinId:
+		return "C";
+	default:
+		return po2c_getlang(id - 1);
+	}
+}
+
+#else // TRANSLATION
+
+// Translation disabled
+
+
+TranslationManager::TranslationManager() {}
+
+TranslationManager::~TranslationManager() {}
+
+void TranslationManager::setLanguage(const char* lang) {}
+
+const char* TranslationManager::getTranslation(const char* message) {
+	return message;
+}
+
+const char* TranslationManager::convertTerm(const char* message) {
+	return message;
+}
+
+#endif // TRANSLATION
+
+}	// End of namespace Common


Property changes on: scummvm/trunk/common/translation.cpp
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/common/translation.h
===================================================================
--- scummvm/trunk/common/translation.h	                        (rev 0)
+++ scummvm/trunk/common/translation.h	2010-06-15 10:44:51 UTC (rev 49759)
@@ -0,0 +1,126 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef COMMON_TRANSLATION_H
+#define COMMON_TRANSLATION_H
+
+#include "common/singleton.h"
+#include "common/str-array.h"
+
+#ifdef TERMCONV
+#include <iconv.h>
+#endif
+
+namespace Common {
+
+enum TranslationIDs {
+	kTranslationAutodetectId = 0,
+	kTranslationBuiltinId = 1000
+};
+
+struct TLanguage {
+	const char *name;
+	int id;
+
+	TLanguage() {
+		name = 0;
+		id = 0;
+	}
+
+	TLanguage(const char *n, int i) {
+		name = n;
+		id = i;
+	}
+};
+
+typedef Array<TLanguage> TLangArray;
+
+/**
+ * Message translation manager.
+ */
+class TranslationManager : public Singleton<TranslationManager> {
+private:
+	char _syslang[6];
+
+#ifdef TERMCONV
+	iconv_t _conversion;
+	char* _convmsg;
+	int _sizeconv;
+
+	bool convert(const char* message);
+#endif // TERMCONV
+
+public:
+	/**
+	 * The constructor detects the system language and sets default
+	 * language to English.
+	 */
+	TranslationManager();
+	~TranslationManager();
+
+	const char *getLangById(int id);
+
+	/**
+	 * Sets the current translation language to the one specified in the
+	 * parameter. If the parameter is an empty string, it sets the default
+	 * system language.
+	 */
+	void setLanguage(const char *);
+	void setLanguage(int id) {
+		setLanguage(getLangById(id));
+	}
+
+	int parseLanguage(const String lang);
+
+	/**
+	 * Returns the translation into the current language of the parameter
+	 * message. In case the message isn't found in the translation catalog,
+	 * it returns the original untranslated message.
+	 */
+	const char* getTranslation(const char* message);
+
+	/**
+	 * Converts the message into the terminal character set (which may be
+	 * different than the GUI's "native" one.
+	 */
+	const char* convertTerm(const char* message);
+
+	const TLangArray getSupportedLanguages() const;
+};
+
+}	// End of namespace Common
+
+#define TransMan Common::TranslationManager::instance()
+
+#ifdef TRANSLATION
+#define _(str) TransMan.getTranslation(str)
+#define _t(str) TransMan.convertTerm(_(str))
+#else
+#define _(str) str
+#define _t(str) str
+#endif
+
+#define _s(str) str
+
+#endif


Property changes on: scummvm/trunk/common/translation.h
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/configure	2010-06-15 10:44:51 UTC (rev 49759)
@@ -136,6 +136,8 @@
 # Default vkeybd/keymapper options
 _vkeybd=no
 _keymapper=no
+# GUI translation options
+_translation=yes
 # Default platform settings
 _backend=sdl
 _endian=unknown
@@ -676,6 +678,7 @@
   --disable-16bit          don't enable 16bit color support
   --disable-scalers        exclude scalers
   --disable-hq-scalers     exclude HQ2x and HQ3x scalers
+  --disable-translation    don't build support for translated messages
   --enable-text-console    use text console instead of graphical console
   --enable-verbose-build   enable regular echoing of commands during build process
 
@@ -760,6 +763,8 @@
 	--default-dynamic)        _plugins_default=dynamic ;;
 	--enable-mt32emu)         _mt32emu=yes    ;;
 	--disable-mt32emu)        _mt32emu=no     ;;
+	--enable-translation)     _translation=yes ;;
+	--disable-translation)    _translation=no ;;
 	--enable-vkeybd)          _vkeybd=yes     ;;
 	--disable-vkeybd)         _vkeybd=no      ;;
 	--enable-keymapper)       _keymapper=yes  ;;
@@ -2312,7 +2317,48 @@
 	DEFINES="$DEFINES -DENABLE_KEYMAPPER"
 fi
 
+# Check whether to build translation support
 #
+echo_n "Building translation support... "
+add_to_config_mk_if_yes $_translation 'ENABLE_TRANSLATION = 1'
+add_to_config_h_if_yes $_translation '#define TRANSLATION'
+if test "$_translation" = no ; then
+	echo "no"
+else
+	echo_n "yes ("
+
+	cat > $TMPC << EOF
+#include <locale.h>
+int main(void) { setlocale(LC_ALL, ""); return 0; }
+EOF
+	_detectlang=no
+	cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes
+
+	add_to_config_h_if_yes $_detectlang '#define DETECTLANG'
+	if test "$_detectlang" = yes ; then
+		echo_n "with runtime language detection, "
+
+		cat > $TMPC << EOF
+#include <langinfo.h>
+#include <iconv.h>
+int main(void) { nl_langinfo(CODESET); iconv_open(0, 0); return 0; }
+EOF
+		_termconv=no
+		cc_check_no_clean $LDFLAGS $CXXFLAGS && _termconv=yes
+		cc_check $LDFLAGS $CXXFLAGS -liconv && LIBS="$LIBS -liconv" && _termconv=yes
+
+		add_to_config_h_if_yes $_termconv '#define TERMCONV'
+		if test "$_termconv" = yes ; then
+			echo "with terminal conversion)"
+		else
+			echo "without terminal conversion)"
+		fi
+	else
+		echo "without runtime language detection)"
+	fi
+fi
+
+#
 # Figure out installation directories
 #
 test "x$prefix" = xNONE && prefix=/usr/local

Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/engines/dialogs.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -28,6 +28,7 @@
 #include "common/savefile.h"
 #include "common/system.h"
 #include "common/events.h"
+#include "common/translation.h"
 
 #include "graphics/scaler.h"
 
@@ -85,37 +86,37 @@
 	StaticTextWidget *version = new StaticTextWidget(this, "GlobalMenu.Version", gScummVMVersionDate);
 	version->setAlign(Graphics::kTextAlignCenter);
 
-	new GUI::ButtonWidget(this, "GlobalMenu.Resume", "Resume", kPlayCmd, 'P');
+	new GUI::ButtonWidget(this, "GlobalMenu.Resume", _("Resume"), kPlayCmd, 'P');
 
-	_loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", "Load", kLoadCmd, 'L');
+	_loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", _("Load"), kLoadCmd, 'L');
 	// TODO: setEnabled -> setVisible
 	_loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime));
 
-	_saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", "Save", kSaveCmd, 'S');
+	_saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", _("Save"), kSaveCmd, 'S');
 	// TODO: setEnabled -> setVisible
 	_saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsSavingDuringRuntime));
 
-	new GUI::ButtonWidget(this, "GlobalMenu.Options", "Options", kOptionsCmd, 'O');
+	new GUI::ButtonWidget(this, "GlobalMenu.Options", _("Options"), kOptionsCmd, 'O');
 
 	// The help button is disabled by default.
 	// To enable "Help", an engine needs to use a subclass of MainMenuDialog
 	// (at least for now, we might change how this works in the future).
-	_helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", "Help", kHelpCmd, 'H');
+	_helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", _("Help"), kHelpCmd, 'H');
 	_helpButton->setEnabled(false);
 
-	new GUI::ButtonWidget(this, "GlobalMenu.About", "About", kAboutCmd, 'A');
+	new GUI::ButtonWidget(this, "GlobalMenu.About", _("About"), kAboutCmd, 'A');
 
-	_rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", "Return to Launcher", kRTLCmd, 'R');
+	_rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", _("Return to Launcher"), kRTLCmd, 'R');
 	_rtlButton->setEnabled(_engine->hasFeature(Engine::kSupportsRTL));
 
 
-	new GUI::ButtonWidget(this, "GlobalMenu.Quit", "Quit", kQuitCmd, 'Q');
+	new GUI::ButtonWidget(this, "GlobalMenu.Quit", _("Quit"), kQuitCmd, 'Q');
 
 	_aboutDialog = new GUI::AboutDialog();
 	_optionsDialog = new ConfigDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions));
-	_loadDialog = new GUI::SaveLoadChooser("Load game:", "Load");
+	_loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"));
 	_loadDialog->setSaveMode(false);
-	_saveDialog = new GUI::SaveLoadChooser("Save game:", "Save");
+	_saveDialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"));
 	_saveDialog->setSaveMode(true);
 }
 
@@ -297,11 +298,11 @@
 	// Add the buttons
 	//
 
-	new GUI::ButtonWidget(this, "GlobalConfig.Ok", "OK", GUI::kOKCmd, 'O');
-	new GUI::ButtonWidget(this, "GlobalConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C');
+	new GUI::ButtonWidget(this, "GlobalConfig.Ok", _("OK"), GUI::kOKCmd, 'O');
+	new GUI::ButtonWidget(this, "GlobalConfig.Cancel", _("Cancel"), GUI::kCloseCmd, 'C');
 
 #ifdef SMALL_SCREEN_DEVICE
-	new GUI::ButtonWidget(this, "GlobalConfig.Keys", "Keys", kKeysCmd, 'K');
+	new GUI::ButtonWidget(this, "GlobalConfig.Keys", _("Keys"), kKeysCmd, 'K');
 	_keysDialog = NULL;
 #endif
 }

Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/GuiManager.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -27,6 +27,7 @@
 #include "common/util.h"
 #include "common/config-manager.h"
 #include "common/algorithm.h"
+#include "common/translation.h"
 
 #include "backends/keymapper/keymapper.h"
 
@@ -71,7 +72,7 @@
 		// Loading the theme failed, try to load the built-in theme
 		if (!loadNewTheme("builtin", gfxMode)) {
 			// Loading the built-in theme failed as well. Bail out
-			error("Failed to load any GUI theme, aborting");
+			error(_t("Failed to load any GUI theme, aborting"));
 		}
 	}
 }
@@ -94,27 +95,28 @@
 	Action *act;
 	Keymap *guiMap = new Keymap("gui");
 
-	act = new Action(guiMap, "CLOS", "Close", kGenericActionType, kStartKeyType);
+	act = new Action(guiMap, "CLOS", _("Close"), kGenericActionType, kStartKeyType);
 	act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));
 
-	act = new Action(guiMap, "CLIK", "Mouse click");
+	act = new Action(guiMap, "CLIK", _("Mouse click"));
 	act->addLeftClickEvent();
 
-	act = new Action(guiMap, "VIRT", "Display keyboard", kVirtualKeyboardActionType);
+	act = new Action(guiMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType);
 	act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0));
 
-	act = new Action(guiMap, "REMP", "Remap keys", kKeyRemapActionType);
+	act = new Action(guiMap, "REMP", _("Remap keys"), kKeyRemapActionType);
 	act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0));
 
 	mapper->addGlobalKeymap(guiMap);
 }
 #endif
 
-bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx) {
+bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx, bool forced) {
 	// If we are asked to reload the currently active theme, just do nothing
 	// FIXME: Actually, why? It might be desirable at times to force a theme reload...
-	if (_theme && id == _theme->getThemeId() && gfx == _theme->getGraphicsMode())
-		return true;
+	if (!forced)
+		if (_theme && id == _theme->getThemeId() && gfx == _theme->getGraphicsMode())
+			return true;
 
 	ThemeEngine *newTheme = 0;
 

Modified: scummvm/trunk/gui/GuiManager.h
===================================================================
--- scummvm/trunk/gui/GuiManager.h	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/GuiManager.h	2010-06-15 10:44:51 UTC (rev 49759)
@@ -71,7 +71,7 @@
 
 	bool isActive() const	{ return ! _dialogStack.empty(); }
 
-	bool loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx = ThemeEngine::kGfxDisabled);
+	bool loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx = ThemeEngine::kGfxDisabled, bool force = false);
 	ThemeEngine *theme() { return _theme; }
 
 	ThemeEval *xmlEval() { return _theme->getEvaluator(); }

Modified: scummvm/trunk/gui/KeysDialog.cpp
===================================================================
--- scummvm/trunk/gui/KeysDialog.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/KeysDialog.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -40,15 +40,15 @@
 KeysDialog::KeysDialog(const Common::String &title)
 	: GUI::Dialog("KeysDialog") {
 
-	new ButtonWidget(this, "KeysDialog.Map", "Map", kMapCmd, 0);
-	new ButtonWidget(this, "KeysDialog.Ok", "OK", kOKCmd, 0);
-	new ButtonWidget(this, "KeysDialog.Cancel", "Cancel", kCloseCmd, 0);
+	new ButtonWidget(this, "KeysDialog.Map", _("Map"), kMapCmd, 0);
+	new ButtonWidget(this, "KeysDialog.Ok", _("OK"), kOKCmd, 0);
+	new ButtonWidget(this, "KeysDialog.Cancel", _("Cancel"), kCloseCmd, 0);
 
 	_actionsList = new ListWidget(this, "KeysDialog.List");
 	_actionsList->setNumberingMode(kListNumberingZero);
 
 	_actionTitle = new StaticTextWidget(this, "KeysDialog.Action", title);
-	_keyMapping = new StaticTextWidget(this, "KeysDialog.Mapping", "Select an action and click 'Map'");
+	_keyMapping = new StaticTextWidget(this, "KeysDialog.Mapping", _("Select an action and click 'Map'"));
 
 	_actionTitle->setFlags(WIDGET_CLEARBG);
 	_keyMapping->setFlags(WIDGET_CLEARBG);
@@ -79,9 +79,9 @@
 				key = key - Common::ASCII_F1 + SDLK_F1;
 #endif
 			if (key != 0)
-				sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+				sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
 			else
-				sprintf(selection, "Associated key : none");
+				sprintf(selection, _("Associated key : none"));
 
 			_keyMapping->setLabel(selection);
 			_keyMapping->draw();
@@ -89,7 +89,7 @@
 		break;
 	case kMapCmd:
 		if (_actionsList->getSelected() < 0) {
-				_actionTitle->setLabel("Please select an action");
+			_actionTitle->setLabel(_("Please select an action"));
 		} else {
 			char selection[100];
 
@@ -101,11 +101,11 @@
 				key = key - Common::ASCII_F1 + SDLK_F1;
 #endif
 			if (key != 0)
-				sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+				sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
 			else
-				sprintf(selection, "Associated key : none");
+				sprintf(selection, _("Associated key : none"));
 
-			_actionTitle->setLabel("Press the key to associate");
+			_actionTitle->setLabel(_("Press the key to associate"));
 			_keyMapping->setLabel(selection);
 			_keyMapping->draw();
 			Actions::Instance()->beginMapping(true);
@@ -140,11 +140,11 @@
 		Actions::Instance()->setMapping((ActionType)_actionSelected, state.ascii);
 
 		if (state.ascii != 0)
-			sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey) state.keycode));
+			sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode));
 		else
-			sprintf(selection, "Associated key : none");
+			sprintf(selection, _("Associated key : none"));
 
-		_actionTitle->setLabel("Choose an action to map");
+		_actionTitle->setLabel(_("Choose an action to map"));
 		_keyMapping->setLabel(selection);
 		_keyMapping->draw();
 		_actionTitle->draw();

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -30,6 +30,7 @@
 #include "common/fs.h"
 #include "common/unzip.h"
 #include "common/tokenizer.h"
+#include "common/translation.h"
 
 #include "graphics/colormasks.h"
 #include "graphics/cursorman.h"
@@ -329,10 +330,10 @@
  *	Rendering mode management
  *********************************************************/
 const ThemeEngine::Renderer ThemeEngine::_rendererModes[] = {
-	{ "Disabled GFX", "none", kGfxDisabled },
-	{ "Standard Renderer (16bpp)", "normal_16bpp", kGfxStandard16bit },
+	{ _s("Disabled GFX"), "none", kGfxDisabled },
+	{ _s("Standard Renderer (16bpp)"), "normal_16bpp", kGfxStandard16bit },
 #ifndef DISABLE_FANCY_THEMES
-	{ "Antialiased Renderer (16bpp)", "aa_16bpp", kGfxAntialias16bit }
+	{ _s("Antialiased Renderer (16bpp)"), "aa_16bpp", kGfxAntialias16bit }
 #endif
 };
 

Modified: scummvm/trunk/gui/about.cpp
===================================================================
--- scummvm/trunk/gui/about.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/about.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -27,6 +27,7 @@
 #include "base/version.h"
 #include "common/events.h"
 #include "common/system.h"
+#include "common/translation.h"
 #include "common/util.h"
 #include "gui/about.h"
 #include "gui/GuiManager.h"
@@ -92,7 +93,7 @@
 	version += gScummVMVersion;
 	_lines.push_back(version);
 
-	Common::String date("C2""(built on ");
+	Common::String date(_s("C2""(built on "));
 	date += gScummVMBuildDate;
 	date += ')';
 	_lines.push_back(date);
@@ -100,14 +101,14 @@
 	for (i = 0; i < ARRAYSIZE(copyright_text); i++)
 		addLine(copyright_text[i]);
 
-	addLine("C1""Features compiled in:");
+	addLine(_s("C1""Features compiled in:"));
 	Common::String features("C0");
 	features += gScummVMFeatures;
 	addLine(features.c_str());
 
 	_lines.push_back("");
 
-	addLine("C1""Available engines:");
+	addLine(_s("C1""Available engines:"));
 	const EnginePlugin::List &plugins = EngineMan.getPlugins();
 	EnginePlugin::List::const_iterator iter = plugins.begin();
 	for (; iter != plugins.end(); ++iter) {

Modified: scummvm/trunk/gui/browser.cpp
===================================================================
--- scummvm/trunk/gui/browser.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/browser.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -30,6 +30,8 @@
 #include "common/system.h"
 #include "common/algorithm.h"
 
+#include "common/translation.h"
+
 namespace GUI {
 
 enum {
@@ -64,9 +66,9 @@
 	_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
 
 	// Buttons
-	new ButtonWidget(this, "Browser.Up", "Go up", kGoUpCmd, 0);
-	new ButtonWidget(this, "Browser.Cancel", "Cancel", kCloseCmd, 0);
-	new ButtonWidget(this, "Browser.Choose", "Choose", kChooseCmd, 0);
+	new ButtonWidget(this, "Browser.Up", _("Go up"), kGoUpCmd, 0);
+	new ButtonWidget(this, "Browser.Cancel", _("Cancel"), kCloseCmd, 0);
+	new ButtonWidget(this, "Browser.Choose", _("Choose"), kChooseCmd, 0);
 }
 
 void BrowserDialog::open() {

Modified: scummvm/trunk/gui/error.cpp
===================================================================
--- scummvm/trunk/gui/error.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/error.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -27,6 +27,8 @@
 #include "gui/message.h"
 #include "gui/error.h"
 
+#include "common/translation.h"
+
 namespace GUI {
 
 void displayErrorDialog(const char *text) {
@@ -37,7 +39,7 @@
 void displayErrorDialog(Common::Error error, const char *extraText) {
 	Common::String errorText(extraText);
 	errorText += " ";
-	errorText += Common::errorToString(error);
+	errorText += _(Common::errorToString(error));
 	GUI::MessageDialog alert(errorText);
 	alert.runModal();
 }

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/launcher.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -30,6 +30,7 @@
 #include "common/util.h"
 #include "common/savefile.h"
 #include "common/system.h"
+#include "common/translation.h"
 
 #include "gui/about.h"
 #include "gui/browser.h"
@@ -166,20 +167,20 @@
 	//
 	// 1) The game tab
 	//
-	tab->addTab("Game");
+	tab->addTab(_("Game"));
 
 	// GUI:  Label & edit widget for the game ID
-	new StaticTextWidget(tab, "GameOptions_Game.Id", "ID:");
+	new StaticTextWidget(tab, "GameOptions_Game.Id", _("ID:"));
 	_domainWidget = new DomainEditTextWidget(tab, "GameOptions_Game.Domain", _domain);
 
 	// GUI:  Label & edit widget for the description
-	new StaticTextWidget(tab, "GameOptions_Game.Name", "Name:");
+	new StaticTextWidget(tab, "GameOptions_Game.Name", _("Name:"));
 	_descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description);
 
 	// Language popup
-	_langPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.LangPopupDesc", "Language:");
+	_langPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.LangPopupDesc", _("Language:"));
 	_langPopUp = new PopUpWidget(tab, "GameOptions_Game.LangPopup");
-	_langPopUp->appendEntry("<default>");
+	_langPopUp->appendEntry(_("<default>"));
 	_langPopUp->appendEntry("");
 	const Common::LanguageDescription *l = Common::g_languages;
 	for (; l->code; ++l) {
@@ -187,9 +188,9 @@
 	}
 
 	// Platform popup
-	_platformPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.PlatformPopupDesc", "Platform:");
+	_platformPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.PlatformPopupDesc", _("Platform:"));
 	_platformPopUp = new PopUpWidget(tab, "GameOptions_Game.PlatformPopup");
-	_platformPopUp->appendEntry("<default>");
+	_platformPopUp->appendEntry(_("<default>"));
 	_platformPopUp->appendEntry("");
 	const Common::PlatformDescription *p = Common::g_platforms;
 	for (; p->code; ++p) {
@@ -199,18 +200,18 @@
 	//
 	// 3) The graphics tab
 	//
-	_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
+	_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
 
-	_globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0);
+	_globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", _("Override global graphic settings"), kCmdGlobalGraphicsOverride, 0);
 
 	addGraphicControls(tab, "GameOptions_Graphics.");
 
 	//
 	// 4) The audio tab
 	//
-	tab->addTab("Audio");
+	tab->addTab(_("Audio"));
 
-	_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0);
+	_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _("Override global audio settings"), kCmdGlobalAudioOverride, 0);
 
 	addAudioControls(tab, "GameOptions_Audio.");
 	addSubtitleControls(tab, "GameOptions_Audio.");
@@ -218,18 +219,18 @@
 	//
 	// 5) The volume tab
 	//
-	tab->addTab("Volume");
+	tab->addTab(_("Volume"));
 
-	_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", "Override global volume settings", kCmdGlobalVolumeOverride, 0);
+	_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _("Override global volume settings"), kCmdGlobalVolumeOverride, 0);
 
 	addVolumeControls(tab, "GameOptions_Volume.");
 
 	//
 	// 6) The MIDI tab
 	//
-	tab->addTab("MIDI");
+	tab->addTab(_("MIDI"));
 
-	_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", "Override global MIDI settings", kCmdGlobalMIDIOverride, 0);
+	_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _("Override global MIDI settings"), kCmdGlobalMIDIOverride, 0);
 
 	if (_guioptions & Common::GUIO_NOMIDI)
 		_globalMIDIOverride->setEnabled(false);
@@ -239,21 +240,21 @@
 	//
 	// 2) The 'Path' tab
 	//
-	tab->addTab("Paths");
+	tab->addTab(_("Paths"));
 
 	// These buttons have to be extra wide, or the text will be truncated
 	// in the small version of the GUI.
 
 	// GUI:  Button + Label for the game path
-	new ButtonWidget(tab, "GameOptions_Paths.Gamepath", "Game Path:", kCmdGameBrowser, 0);
+	new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _("Game Path:"), kCmdGameBrowser, 0);
 	_gamePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.GamepathText", gamePath);
 
 	// GUI:  Button + Label for the additional path
-	new ButtonWidget(tab, "GameOptions_Paths.Extrapath", "Extra Path:", kCmdExtraBrowser, 0);
+	new ButtonWidget(tab, "GameOptions_Paths.Extrapath", _("Extra Path:"), kCmdExtraBrowser, 0);
 	_extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath);
 
 	// GUI:  Button + Label for the save path
-	new ButtonWidget(tab, "GameOptions_Paths.Savepath", "Save Path:", kCmdSaveBrowser, 0);
+	new ButtonWidget(tab, "GameOptions_Paths.Savepath", _("Save Path:"), kCmdSaveBrowser, 0);
 	_savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath);
 
 	// Activate the first tab
@@ -261,8 +262,8 @@
 	_tabWidget = tab;
 
 	// Add OK & Cancel buttons
-	new ButtonWidget(this, "GameOptions.Cancel", "Cancel", kCloseCmd, 0);
-	new ButtonWidget(this, "GameOptions.Ok", "OK", kOKCmd, 0);
+	new ButtonWidget(this, "GameOptions.Cancel", _("Cancel"), kCloseCmd, 0);
+	new ButtonWidget(this, "GameOptions.Ok", _("OK"), kOKCmd, 0);
 }
 
 void EditGameDialog::open() {
@@ -270,12 +271,12 @@
 
 	String extraPath(ConfMan.get("extrapath", _domain));
 	if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
-		_extraPathWidget->setLabel("None");
+		_extraPathWidget->setLabel(_("None"));
 	}
 
 	String savePath(ConfMan.get("savepath", _domain));
 	if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
-		_savePathWidget->setLabel("Default");
+		_savePathWidget->setLabel(_("Default"));
 	}
 
 	int sel, i;
@@ -349,11 +350,11 @@
 			ConfMan.set("path", gamePath, _domain);
 
 		String extraPath(_extraPathWidget->getLabel());
-		if (!extraPath.empty() && (extraPath != "None"))
+		if (!extraPath.empty() && (extraPath != _("None")))
 			ConfMan.set("extrapath", extraPath, _domain);
 
 		String savePath(_savePathWidget->getLabel());
-		if (!savePath.empty() && (savePath != "Default"))
+		if (!savePath.empty() && (savePath != _("Default")))
 			ConfMan.set("savepath", savePath, _domain);
 
 		Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag();
@@ -387,14 +388,14 @@
 		draw();
 		break;
 	case kCmdChooseSoundFontCmd: {
-		BrowserDialog browser("Select SoundFont", false);
+		BrowserDialog browser(_("Select SoundFont"), false);
 
 		if (browser.runModal() > 0) {
 			// User made this choice...
 			Common::FSNode file(browser.getResult());
 			_soundFont->setLabel(file.getPath());
 
-			if (!file.getPath().empty() && (file.getPath() != "None"))
+			if (!file.getPath().empty() && (file.getPath() != _("None")))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);
@@ -406,7 +407,7 @@
 
 	// Change path for the game
 	case kCmdGameBrowser: {
-		BrowserDialog browser("Select directory with game data", true);
+		BrowserDialog browser(_("Select directory with game data"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -424,7 +425,7 @@
 
 	// Change path for extra game data (eg, using sword cutscenes when playing via CD)
 	case kCmdExtraBrowser: {
-		BrowserDialog browser("Select additional game directory", true);
+		BrowserDialog browser(_("Select additional game directory"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -436,7 +437,7 @@
 	}
 	// Change path for stored save game (perm and temp) data
 	case kCmdSaveBrowser: {
-		BrowserDialog browser("Select directory for saved games", true);
+		BrowserDialog browser(_("Select directory for saved games"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -455,7 +456,7 @@
 				|| newDomain.hasPrefix("_")
 				|| newDomain == ConfigManager::kApplicationDomain
 				|| ConfMan.hasGameDomain(newDomain)) {
-				MessageDialog alert("This game ID is already taken. Please choose another one.");
+				MessageDialog alert(_("This game ID is already taken. Please choose another one."));
 				alert.runModal();
 				return;
 			}
@@ -496,22 +497,22 @@
 	new StaticTextWidget(this, "Launcher.Version", gScummVMFullVersion);
 #endif
 
-	new ButtonWidget(this, "Launcher.QuitButton", "Quit", kQuitCmd, 'Q');
-	new ButtonWidget(this, "Launcher.AboutButton", "About...", kAboutCmd, 'B');
-	new ButtonWidget(this, "Launcher.OptionsButton", "Options...", kOptionsCmd, 'O');
+	new ButtonWidget(this, "Launcher.QuitButton", _("Quit"), kQuitCmd, 'Q');
+	new ButtonWidget(this, "Launcher.AboutButton", _("About..."), kAboutCmd, 'B');
+	new ButtonWidget(this, "Launcher.OptionsButton", _("Options..."), kOptionsCmd, 'O');
 	_startButton =
-			new ButtonWidget(this, "Launcher.StartButton", "Start", kStartCmd, 'S');
+		new ButtonWidget(this, "Launcher.StartButton", _("Start"), kStartCmd, 'S');
 
 	_loadButton =
-		new ButtonWidget(this, "Launcher.LoadGameButton", "Load...", kLoadGameCmd, 'L');
+		new ButtonWidget(this, "Launcher.LoadGameButton", _("Load..."), kLoadGameCmd, 'L');
 
 	// Above the lowest button rows: two more buttons (directly below the list box)
 	_addButton =
-		new ButtonWidget(this, "Launcher.AddGameButton", "Add Game...", kAddGameCmd, 'A');
+		new ButtonWidget(this, "Launcher.AddGameButton", _("Add Game..."), kAddGameCmd, 'A');
 	_editButton =
-		new ButtonWidget(this, "Launcher.EditGameButton", "Edit Game...", kEditGameCmd, 'E');
+		new ButtonWidget(this, "Launcher.EditGameButton", _("Edit Game..."), kEditGameCmd, 'E');
 	_removeButton =
-		new ButtonWidget(this, "Launcher.RemoveGameButton", "Remove Game", kRemoveGameCmd, 'R');
+		new ButtonWidget(this, "Launcher.RemoveGameButton", _("Remove Game"), kRemoveGameCmd, 'R');
 
 	// Search box
 	_searchDesc = 0;
@@ -522,7 +523,7 @@
 		_searchPic->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSearch));
 	} else
 #endif
-		_searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", "Search:");
+		_searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", _("Search:"));
 
 	_searchWidget = new EditTextWidget(this, "Launcher.Search", _search, kSearchCmd);
 	_searchClearButton = new ButtonWidget(this, "Launcher.SearchClearButton", "C", kSearchClearCmd, 0);
@@ -544,10 +545,10 @@
 	updateButtons();
 
 	// Create file browser dialog
-	_browser = new BrowserDialog("Select directory with game data", true);
+	_browser = new BrowserDialog(_("Select directory with game data"), true);
 
 	// Create Load dialog
-	_loadDialog = new SaveLoadChooser("Load game:", "Load");
+	_loadDialog = new SaveLoadChooser(_("Load game:"), _("Load"));
 }
 
 void LauncherDialog::selectTarget(const String &target) {
@@ -619,9 +620,13 @@
 				description = g.description();
 		}
 
-		if (description.empty())
-			description = "Unknown (target " + iter->_key + ", gameid " + gameid + ")";
+		if (description.empty()) {
+			char tmp[200];
 
+			snprintf(tmp, 200, "Unknown (target %s, gameid %s)", iter->_key.c_str(), gameid.c_str());
+			description = tmp;
+		}
+
 		if (!gameid.empty() && !description.empty()) {
 			// Insert the game into the launcher list
 			int pos = 0, size = l.size();
@@ -652,8 +657,8 @@
 	const bool massAdd = (modifiers & Common::KBD_SHIFT) != 0;
 
 	if (massAdd) {
-		MessageDialog alert("Do you really want to run the mass game detector? "
-							"This could potentially add a huge number of games.", "Yes", "No");
+		MessageDialog alert(_("Do you really want to run the mass game detector? "
+							  "This could potentially add a huge number of games."), _("Yes"), _("No"));
 		if (alert.runModal() == GUI::kMessageOK && _browser->runModal() > 0) {
 			MassAddDialog massAddDlg(_browser->getResult());
 
@@ -700,7 +705,7 @@
 			Common::FSNode dir(_browser->getResult());
 			Common::FSList files;
 			if (!dir.getChildren(files, Common::FSNode::kListAll)) {
-				MessageDialog alert("ScummVM couldn't open the specified directory!");
+				MessageDialog alert(_("ScummVM couldn't open the specified directory!"));
 				alert.runModal();
 				return;
 			}
@@ -712,7 +717,7 @@
 			int idx;
 			if (candidates.empty()) {
 				// No game was found in the specified directory
-				MessageDialog alert("ScummVM could not find any game in the specified directory!");
+				MessageDialog alert(_("ScummVM could not find any game in the specified directory!"));
 				alert.runModal();
 				idx = -1;
 
@@ -726,7 +731,7 @@
 				for (idx = 0; idx < (int)candidates.size(); idx++)
 					list.push_back(candidates[idx].description());
 
-				ChooserDialog dialog("Pick the game:");
+				ChooserDialog dialog(_("Pick the game:"));
 				dialog.setList(list);
 				idx = dialog.runModal();
 			}
@@ -802,7 +807,7 @@
 }
 
 void LauncherDialog::removeGame(int item) {
-	MessageDialog alert("Do you really want to remove this game configuration?", "Yes", "No");
+	MessageDialog alert(_("Do you really want to remove this game configuration?"), _("Yes"), _("No"));
 
 	if (alert.runModal() == GUI::kMessageOK) {
 		// Remove the currently selected game from the list
@@ -865,11 +870,11 @@
 			}
 		} else {
 			MessageDialog dialog
-				("This game does not support loading games from the launcher.", "OK");
+				(_("This game does not support loading games from the launcher."), _("OK"));
 			dialog.runModal();
 		}
 	} else {
-		MessageDialog dialog("ScummVM could not find any engine capable of running the selected game!", "OK");
+		MessageDialog dialog(_("ScummVM could not find any engine capable of running the selected game!"), _("OK"));
 		dialog.runModal();
 	}
 }
@@ -981,8 +986,8 @@
 	int modifiers = g_system->getEventManager()->getModifierState();
 	const bool massAdd = (modifiers & Common::KBD_SHIFT) != 0;
 	const char *newAddButtonLabel = massAdd
-		? "Mass Add..."
-		: "Add Game...";
+		? _("Mass Add...")
+		: _("Add Game...");
 
 	if (_addButton->getLabel() != newAddButtonLabel)
 		_addButton->setLabel(newAddButtonLabel);
@@ -1029,7 +1034,7 @@
 		}
 	} else {
 		if (!_searchDesc)
-			_searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", "Search:");
+			_searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", _("Search:"));
 
 		if (_searchPic) {
 			removeWidget(_searchPic);

Modified: scummvm/trunk/gui/massadd.cpp
===================================================================
--- scummvm/trunk/gui/massadd.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/massadd.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -27,6 +27,7 @@
 #include "common/events.h"
 #include "common/func.h"
 #include "common/config-manager.h"
+#include "common/translation.h"
 
 #include "gui/launcher.h"	// For addGameToConf()
 #include "gui/massadd.h"
@@ -75,10 +76,10 @@
 //	new StaticTextWidget(this, "massadddialog_caption",	"Mass Add Dialog");
 
 	_dirProgressText = new StaticTextWidget(this, "MassAdd.DirProgressText",
-											"... progress ...");
+											_("... progress ..."));
 
 	_gameProgressText = new StaticTextWidget(this, "MassAdd.GameProgressText",
-											 "... progress ...");
+											 _("... progress ..."));
 
 	_dirProgressText->setAlign(Graphics::kTextAlignCenter);
 	_gameProgressText->setAlign(Graphics::kTextAlignCenter);
@@ -88,10 +89,10 @@
 	_list->setNumberingMode(kListNumberingOff);
 	_list->setList(l);
 
-	_okButton = new ButtonWidget(this, "MassAdd.Ok", "OK", kOkCmd, Common::ASCII_RETURN);
+	_okButton = new ButtonWidget(this, "MassAdd.Ok", _("OK"), kOkCmd, Common::ASCII_RETURN);
 	_okButton->setEnabled(false);
 
-	new ButtonWidget(this, "MassAdd.Cancel", "Cancel", kCancelCmd, Common::ASCII_ESCAPE);
+	new ButtonWidget(this, "MassAdd.Cancel", _("Cancel"), kCancelCmd, Common::ASCII_ESCAPE);
 
 	// Build a map from all configured game paths to the targets using them
 	const Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
@@ -240,17 +241,17 @@
 		// Enable the OK button
 		_okButton->setEnabled(true);
 
-		snprintf(buf, sizeof(buf), "Scan complete!");
+		snprintf(buf, sizeof(buf), _("Scan complete!"));
 		_dirProgressText->setLabel(buf);
 
-		snprintf(buf, sizeof(buf), "Discovered %d new games.", _games.size());
+		snprintf(buf, sizeof(buf), _("Discovered %d new games."), _games.size());
 		_gameProgressText->setLabel(buf);
 
 	} else {
-		snprintf(buf, sizeof(buf), "Scanned %d directories ...", _dirsScanned);
+		snprintf(buf, sizeof(buf), _("Scanned %d directories ..."), _dirsScanned);
 		_dirProgressText->setLabel(buf);
 
-		snprintf(buf, sizeof(buf), "Discovered %d new games ...", _games.size());
+		snprintf(buf, sizeof(buf), _("Discovered %d new games ..."), _games.size());
 		_gameProgressText->setLabel(buf);
 	}
 

Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/options.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -35,6 +35,7 @@
 #include "common/fs.h"
 #include "common/config-manager.h"
 #include "common/system.h"
+#include "common/translation.h"
 
 #include "graphics/scaler.h"
 
@@ -67,9 +68,9 @@
 };
 #endif
 
-static const char *savePeriodLabels[] = { "Never", "every 5 mins", "every 10 mins", "every 15 mins", "every 30 mins", 0 };
+static const char *savePeriodLabels[] = { _s("Never"), _s("every 5 mins"), _s("every 10 mins"), _s("every 15 mins"), _s("every 30 mins"), 0 };
 static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
-static const char *outputRateLabels[] = { "<default>", "8 kHz", "11kHz", "22 kHz", "44 kHz", "48 kHz", 0 };
+static const char *outputRateLabels[] = { _s("<default>"), _s("8 kHz"), _s("11kHz"), _s("22 kHz"), _s("44 kHz"), _s("48 kHz"), 0 };
 static const int outputRateValues[] = { 0, 8000, 11025, 22050, 44100, 48000, -1 };
 
 
@@ -85,15 +86,15 @@
 }
 
 const char *OptionsDialog::_subModeDesc[] = {
-	"Speech Only",
-	"Speech and Subtitles",
-	"Subtitles Only"
+	_s("Speech Only"),
+	_s("Speech and Subtitles"),
+	_s("Subtitles Only")
 };
 
 const char *OptionsDialog::_lowresSubModeDesc[] = {
-	"Speech Only",
-	"Speech & Subs",
-	"Subtitles Only"
+	_s("Speech Only"),
+	_s("Speech & Subs"),
+	_s("Subtitles Only")
 };
 
 void OptionsDialog::init() {
@@ -222,7 +223,7 @@
 
 		Common::String soundFont(ConfMan.get("soundfont", _domain));
 		if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) {
-			_soundFont->setLabel("None");
+			_soundFont->setLabel(_("None"));
 			_soundFontClearButton->setEnabled(false);
 		} else {
 			_soundFont->setLabel(soundFont);
@@ -267,7 +268,7 @@
 		int speed;		int sliderMaxValue = _subSpeedSlider->getMaxValue();
 
 		_subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain));
-		_subToggleButton->setLabel(_subModeDesc[_subMode]);
+		_subToggleButton->setLabel(_(_subModeDesc[_subMode]));
 
 		// Engines that reuse the subtitle speed widget set their own max value.
 		// Scale the config value accordingly (see addSubtitleControls)
@@ -378,7 +379,7 @@
 				ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain);
 
 				Common::String soundFont(_soundFont->getLabel());
-				if (!soundFont.empty() && (soundFont != "None"))
+				if (!soundFont.empty() && (soundFont != _("None")))
 					ConfMan.set("soundfont", soundFont, _domain);
 				else
 					ConfMan.removeKey("soundfont", _domain);
@@ -465,7 +466,7 @@
 		else
 			_subMode = 0;
 
-		_subToggleButton->setLabel(g_system->getOverlayWidth() > 320 ? _subModeDesc[_subMode] : _lowresSubModeDesc[_subMode]);
+		_subToggleButton->setLabel(g_system->getOverlayWidth() > 320 ? _(_subModeDesc[_subMode]) : _(_lowresSubModeDesc[_subMode]));
 		_subToggleButton->draw();
 		_subSpeedDesc->draw();
 		_subSpeedSlider->draw();
@@ -476,7 +477,7 @@
 		_subSpeedLabel->draw();
 		break;
 	case kClearSoundFontCmd:
-		_soundFont->setLabel("None");
+		_soundFont->setLabel(_("None"));
 		_soundFontClearButton->setEnabled(false);
 		draw();
 		break;
@@ -522,7 +523,7 @@
 	_soundFontButton->setEnabled(enabled);
 	_soundFont->setEnabled(enabled);
 
-	if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != "None"))
+	if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _("None")))
 		_soundFontClearButton->setEnabled(enabled);
 	else
 		_soundFontClearButton->setEnabled(false);
@@ -591,64 +592,64 @@
 	const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
 
 	// The GFX mode popup
-	_gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", "Graphics mode:");
+	_gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", _("Graphics mode:"));
 	_gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup");
 
-	_gfxPopUp->appendEntry("<default>");
+	_gfxPopUp->appendEntry(_("<default>"));
 	_gfxPopUp->appendEntry("");
 	while (gm->name) {
-		_gfxPopUp->appendEntry(gm->description, gm->id);
+		_gfxPopUp->appendEntry(_(gm->description), gm->id);
 		gm++;
 	}
 
 	// RenderMode popup
-	_renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", "Render mode:");
+	_renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", _("Render mode:"));
 	_renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup");
-	_renderModePopUp->appendEntry("<default>", Common::kRenderDefault);
+	_renderModePopUp->appendEntry(_("<default>"), Common::kRenderDefault);
 	_renderModePopUp->appendEntry("");
 	const Common::RenderModeDescription *rm = Common::g_renderModes;
 	for (; rm->code; ++rm) {
-		_renderModePopUp->appendEntry(rm->description, rm->id);
+		_renderModePopUp->appendEntry(_(rm->description), rm->id);
 	}
 
 	// Fullscreen checkbox
-	_fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", "Fullscreen mode", 0, 0);
+	_fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode"), 0, 0);
 
 	// Aspect ratio checkbox
-	_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", "Aspect ratio correction", 0, 0);
+	_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), 0, 0);
 
 	_enableGraphicSettings = true;
 }
 
 void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &prefix) {
 	// The MIDI mode popup & a label
-	_midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", "Music driver:");
+	_midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _("Music driver:"));
 	_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup");
 
 	// Populate it
 	const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
 	while (md->name) {
-		_midiPopUp->appendEntry(md->description, md->id);
+		_midiPopUp->appendEntry(_(md->description), md->id);
 		md++;
 	}
 
 	// The OPL emulator popup & a label
-	_oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", "AdLib emulator:");
+	_oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", _("AdLib emulator:"));
 	_oplPopUp = new PopUpWidget(boss, prefix + "auOPLPopup");
 
 	// Populate it
 	const OPL::Config::EmulatorDescription *ed = OPL::Config::getAvailable();
 	while (ed->name) {
-		_oplPopUp->appendEntry(ed->description, ed->id);
+		_oplPopUp->appendEntry(_(ed->description), ed->id);
 		++ed;
 	}
 
 	// Sample rate settings
-	_outputRatePopUpDesc = new StaticTextWidget(boss, prefix + "auSampleRatePopupDesc", "Output rate:");
+	_outputRatePopUpDesc = new StaticTextWidget(boss, prefix + "auSampleRatePopupDesc", _("Output rate:"));
 	_outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup");
 
 	for (int i = 0; outputRateLabels[i]; i++) {
-		_outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]);
+		_outputRatePopUp->appendEntry(_(outputRateLabels[i]), outputRateValues[i]);
 	}
 
 	_enableAudioSettings = true;
@@ -656,21 +657,21 @@
 
 void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefix) {
 	// SoundFont
-	_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", "SoundFont:", kChooseSoundFontCmd, 0);
-	_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", "None");
+	_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), kChooseSoundFontCmd, 0);
+	_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"));
 	_soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", kClearSoundFontCmd, 0);
 
 	// Multi midi setting
-	_multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", "Mixed AdLib/MIDI mode", 0, 0);
+	_multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", _("Mixed AdLib/MIDI mode"), 0, 0);
 
 	// Native mt32 setting
-	_mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", "True Roland MT-32 (disable GM emulation)", 0, 0);
+	_mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), 0, 0);
 
 	// GS Extensions setting
-	_enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", "Enable Roland GS Mode", 0, 0);
+	_enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), 0, 0);
 
 	// MIDI gain setting (FluidSynth uses this)
-	_midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", "MIDI gain:");
+	_midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:"));
 	_midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", kMidiGainChanged);
 	_midiGainSlider->setMinValue(0);
 	_midiGainSlider->setMaxValue(1000);
@@ -683,11 +684,11 @@
 // make use of the widgets. The launcher range is 0-255. SCUMM's 0-9
 void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal) {
 
-	_subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", "Text and Speech:");
+	_subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:"));
 	_subToggleButton = new ButtonWidget(boss, prefix + "subToggleButton", "", kSubtitleToggle, 0);
 
 	// Subtitle speed
-	_subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", "Subtitle speed:");
+	_subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:"));
 	_subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", kSubtitleSpeedChanged);
 	_subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%");
 	_subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal);
@@ -699,24 +700,24 @@
 void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &prefix) {
 
 	// Volume controllers
-	_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", "Music volume:");
+	_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:"));
 	_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", kMusicVolumeChanged);
 	_musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%");
 	_musicVolumeSlider->setMinValue(0);
 	_musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
 	_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
 
-	_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", "Mute All", kMuteAllChanged, 0);
+	_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute All"), kMuteAllChanged, 0);
 
 
-	_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");
+	_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"));
 	_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged);
 	_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%");
 	_sfxVolumeSlider->setMinValue(0);
 	_sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
 	_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
 
-	_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , "Speech volume:");
+	_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:"));
 	_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", kSpeechVolumeChanged);
 	_speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%");
 	_speechVolumeSlider->setMinValue(0);
@@ -745,7 +746,7 @@
 
 void OptionsDialog::reflowLayout() {
 	if (_graphicsTabId != -1 && _tabWidget)
-		_tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
+		_tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
 
 	Dialog::reflowLayout();
 }
@@ -762,17 +763,17 @@
 	//
 	// 1) The graphics tab
 	//
-	_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
+	_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
 	addGraphicControls(tab, "GlobalOptions_Graphics.");
 
 	//
 	// 2) The audio tab
 	//
-	tab->addTab("Audio");
+	tab->addTab(_("Audio"));
 	addAudioControls(tab, "GlobalOptions_Audio.");
 	addSubtitleControls(tab, "GlobalOptions_Audio.");
 
-	tab->addTab("Volume");
+	tab->addTab(_("Volume"));
 	addVolumeControls(tab, "GlobalOptions_Volume.");
 
 	// TODO: cd drive setting
@@ -780,67 +781,85 @@
 	//
 	// 3) The MIDI tab
 	//
-	tab->addTab("MIDI");
+	tab->addTab(_("MIDI"));
 	addMIDIControls(tab, "GlobalOptions_MIDI.");
 
 	//
 	// 4) The miscellaneous tab
 	//
-	tab->addTab("Paths");
+	tab->addTab(_("Paths"));
 
 #if !( defined(__DC__) || defined(__GP32__) )
 	// These two buttons have to be extra wide, or the text will be
 	// truncated in the small version of the GUI.
 
 	// Save game path
-	new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", "Save Path: ", kChooseSaveDirCmd, 0);
+	new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _("Save Path: "), kChooseSaveDirCmd, 0);
 	_savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar");
 
-	new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", "Theme Path:", kChooseThemeDirCmd, 0);
-	_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", "None");
+	new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), kChooseThemeDirCmd, 0);
+	_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _("None"));
 
-	new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", "Extra Path:", kChooseExtraDirCmd, 0);
-	_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", "None");
+	new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), kChooseExtraDirCmd, 0);
+	_extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _("None"));
 
 #ifdef DYNAMIC_MODULES
-	new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", "Plugins Path:", kChoosePluginsDirCmd, 0);
-	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", "None");
+	new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), kChoosePluginsDirCmd, 0);
+	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _("None"));
 #endif
 #endif
 
-	tab->addTab("Misc");
+	tab->addTab(_("Misc"));
 
-	new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", "Theme:", kChooseThemeCmd, 0);
+	new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), kChooseThemeCmd, 0);
 	_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
 
 
-	_rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", "GUI Renderer:");
+	_rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", _("GUI Renderer:"));
 	_rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.RendererPopup");
 
 	for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i)
-		_rendererPopUp->appendEntry(GUI::ThemeEngine::_rendererModes[i].name, GUI::ThemeEngine::_rendererModes[i].mode);
+		_rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode);
 
-	_autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", "Autosave:");
+	_autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:"));
 	_autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopup");
 
 	for (int i = 0; savePeriodLabels[i]; i++) {
-		_autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]);
+		_autosavePeriodPopUp->appendEntry(_(savePeriodLabels[i]), savePeriodValues[i]);
 	}
 
 #ifdef SMALL_SCREEN_DEVICE
-	new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", "Keys", kChooseKeyMappingCmd, 0);
+	new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", _("Keys"), kChooseKeyMappingCmd, 0);
 #endif
 
 	// TODO: joystick setting
 
 
+#ifdef TRANSLATION
+	_guiLanguagePopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.GuiLanguagePopupDesc", _("Language:"));
+	_guiLanguagePopUp = new PopUpWidget(tab, "GlobalOptions_Misc.GuiLanguagePopup");
+#ifdef DETECTLANG
+	_guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId);
+#endif // DETECTLANG
+	_guiLanguagePopUp->appendEntry(_("English"), Common::kTranslationBuiltinId);
+	_guiLanguagePopUp->appendEntry("", 0);
+	Common::TLangArray languages = TransMan.getSupportedLanguages();
+	Common::TLangArray::iterator lang = languages.begin();
+	while (lang != languages.end()) {
+		_guiLanguagePopUp->appendEntry(lang->name, lang->id);
+		lang++;
+	}
+	_guiLanguagePopUp->setSelectedTag(TransMan.parseLanguage(ConfMan.get("gui_language").c_str()));
+
+#endif // TRANSLATION
+
 	// Activate the first tab
 	tab->setActiveTab(0);
 	_tabWidget = tab;
 
 	// Add OK & Cancel buttons
-	new ButtonWidget(this, "GlobalOptions.Cancel", "Cancel", kCloseCmd, 0);
-	new ButtonWidget(this, "GlobalOptions.Ok", "OK", kOKCmd, 0);
+	new ButtonWidget(this, "GlobalOptions.Cancel", _("Cancel"), kCloseCmd, 0);
+	new ButtonWidget(this, "GlobalOptions.Ok", _("OK"), kOKCmd, 0);
 
 #ifdef SMALL_SCREEN_DEVICE
 	_keysDialog = new KeysDialog();
@@ -863,19 +882,19 @@
 	Common::String extraPath(ConfMan.get("extrapath", _domain));
 
 	if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
-		_savePath->setLabel("None");
+		_savePath->setLabel(_("None"));
 	} else {
 		_savePath->setLabel(savePath);
 	}
 
 	if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) {
-		_themePath->setLabel("None");
+		_themePath->setLabel(_("None"));
 	} else {
 		_themePath->setLabel(themePath);
 	}
 
 	if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
-		_extraPath->setLabel("None");
+		_extraPath->setLabel(_("None"));
 	} else {
 		_extraPath->setLabel(extraPath);
 	}
@@ -883,7 +902,7 @@
 #ifdef DYNAMIC_MODULES
 	Common::String pluginsPath(ConfMan.get("pluginspath", _domain));
 	if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) {
-		_pluginsPath->setLabel("None");
+		_pluginsPath->setLabel(_("None"));
 	} else {
 		_pluginsPath->setLabel(pluginsPath);
 	}
@@ -907,24 +926,24 @@
 void GlobalOptionsDialog::close() {
 	if (getResult()) {
 		Common::String savePath(_savePath->getLabel());
-		if (!savePath.empty() && (savePath != "None"))
+		if (!savePath.empty() && (savePath != _("None")))
 			ConfMan.set("savepath", savePath, _domain);
 
 		Common::String themePath(_themePath->getLabel());
-		if (!themePath.empty() && (themePath != "None"))
+		if (!themePath.empty() && (themePath != _("None")))
 			ConfMan.set("themepath", themePath, _domain);
 		else
 			ConfMan.removeKey("themepath", _domain);
 
 		Common::String extraPath(_extraPath->getLabel());
-		if (!extraPath.empty() && (extraPath != "None"))
+		if (!extraPath.empty() && (extraPath != _("None")))
 			ConfMan.set("extrapath", extraPath, _domain);
 		else
 			ConfMan.removeKey("extrapath", _domain);
 
 #ifdef DYNAMIC_MODULES
 		Common::String pluginsPath(_pluginsPath->getLabel());
-		if (!pluginsPath.empty() && (pluginsPath != "None"))
+		if (!pluginsPath.empty() && (pluginsPath != _("None")))
 			ConfMan.set("pluginspath", pluginsPath, _domain);
 		else
 			ConfMan.removeKey("pluginspath", _domain);
@@ -940,6 +959,28 @@
 			g_gui.loadNewTheme(g_gui.theme()->getThemeId(), selected);
 			ConfMan.set("gui_renderer", cfg, _domain);
 		}
+#ifdef TRANSLATION
+		Common::String oldLang = ConfMan.get("gui_language");
+		int selLang = _guiLanguagePopUp->getSelectedTag();
+
+		ConfMan.set("gui_language", TransMan.getLangById(selLang));
+
+		Common::String newLang = ConfMan.get("gui_language").c_str();
+		if (newLang != oldLang) {
+#if 0
+			// Activate the selected language
+			TransMan.setLanguage(selLang);
+
+			// FIXME: Actually, any changes (including the theme change) should
+			// only become active *after* the options dialog has closed.
+			g_gui.loadNewTheme(g_gui.theme()->getThemeId(), ThemeEngine::kGfxDisabled, true);
+#else
+			MessageDialog error(_("You have to restart ScummVM to take the effect."));
+			error.runModal();
+#endif
+		}
+#endif // TRANSLATION
+
 	}
 	OptionsDialog::close();
 }
@@ -947,14 +988,14 @@
 void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 	switch (cmd) {
 	case kChooseSaveDirCmd: {
-		BrowserDialog browser("Select directory for savegames", true);
+		BrowserDialog browser(_("Select directory for savegames"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
 			if (dir.isWritable()) {
 				_savePath->setLabel(dir.getPath());
 			} else {
-				MessageDialog error("The chosen directory cannot be written to. Please select another one.");
+				MessageDialog error(_("The chosen directory cannot be written to. Please select another one."));
 				error.runModal();
 				return;
 			}
@@ -963,7 +1004,7 @@
 		break;
 	}
 	case kChooseThemeDirCmd: {
-		BrowserDialog browser("Select directory for GUI themes", true);
+		BrowserDialog browser(_("Select directory for GUI themes"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -973,7 +1014,7 @@
 		break;
 	}
 	case kChooseExtraDirCmd: {
-		BrowserDialog browser("Select directory for extra files", true);
+		BrowserDialog browser(_("Select directory for extra files"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -984,7 +1025,7 @@
 	}
 #ifdef DYNAMIC_MODULES
 	case kChoosePluginsDirCmd: {
-		BrowserDialog browser("Select directory for plugins", true);
+		BrowserDialog browser(_("Select directory for plugins"), true);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode dir(browser.getResult());
@@ -995,13 +1036,13 @@
 	}
 #endif
 	case kChooseSoundFontCmd: {
-		BrowserDialog browser("Select SoundFont", false);
+		BrowserDialog browser(_("Select SoundFont"), false);
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			Common::FSNode file(browser.getResult());
 			_soundFont->setLabel(file.getPath());
 
-			if (!file.getPath().empty() && (file.getPath() != "None"))
+			if (!file.getPath().empty() && (file.getPath() != _("None")))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);

Modified: scummvm/trunk/gui/options.h
===================================================================
--- scummvm/trunk/gui/options.h	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/options.h	2010-06-15 10:44:51 UTC (rev 49759)
@@ -184,6 +184,8 @@
 	PopUpWidget *_rendererPopUp;
 	StaticTextWidget *_autosavePeriodPopUpDesc;
 	PopUpWidget *_autosavePeriodPopUp;
+	StaticTextWidget *_guiLanguagePopUpDesc;
+	PopUpWidget *_guiLanguagePopUp;
 };
 
 } // End of namespace GUI

Modified: scummvm/trunk/gui/saveload.cpp
===================================================================
--- scummvm/trunk/gui/saveload.cpp	2010-06-15 10:38:39 UTC (rev 49758)
+++ scummvm/trunk/gui/saveload.cpp	2010-06-15 10:44:51 UTC (rev 49759)
@@ -23,6 +23,7 @@
  */
 
 #include "common/config-manager.h"
+#include "common/translation.h"
 
 #include "gui/ListWidget.h"
 #include "gui/message.h"
@@ -56,16 +57,16 @@
 
 	_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
 
-	_date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", Graphics::kTextAlignCenter);
-	_time = new StaticTextWidget(this, 0, 0, 10, 10, "No time saved", Graphics::kTextAlignCenter);
-	_playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", Graphics::kTextAlignCenter);
+	_date = new StaticTextWidget(this, 0, 0, 10, 10, _("No date saved"), Graphics::kTextAlignCenter);
+	_time = new StaticTextWidget(this, 0, 0, 10, 10, _("No time saved"), Graphics::kTextAlignCenter);
+	_playtime = new StaticTextWidget(this, 0, 0, 10, 10, _("No playtime saved"), Graphics::kTextAlignCenter);
 
 	// Buttons
-	new GUI::ButtonWidget(this, "SaveLoadChooser.Cancel", "Cancel", kCloseCmd, 0);
+	new GUI::ButtonWidget(this, "SaveLoadChooser.Cancel", _("Cancel"), kCloseCmd, 0);
 	_chooseButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Choose", buttonLabel, kChooseCmd, 0);
 	_chooseButton->setEnabled(false);
 
-	_deleteButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Delete", "Delete", kDelCmd, 0);
+	_deleteButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Delete", _("Delete"), kDelCmd, 0);
 	_deleteButton->setEnabled(false);
 
 	_delSupport = _metaInfoSupport = _thumbnailSupport = false;
@@ -152,8 +153,8 @@
 		break;
 	case kDelCmd:
 		if (selItem >= 0 && _delSupport) {
-			MessageDialog alert("Do you really want to delete this savegame?",
-								"Delete", "Cancel");
+			MessageDialog alert(_("Do you really want to delete this savegame?"),
+								_("Delete"), _("Cancel"));
 			if (alert.runModal() == GUI::kMessageOK) {
 				(*_plugin)->removeSaveState(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
 
@@ -237,9 +238,9 @@
 	bool startEditMode = _list->isEditable();
 
 	_gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
-	_date->setLabel("No date saved");
-	_time->setLabel("No time saved");
-	_playtime->setLabel("No playtime saved");
+	_date->setLabel(_("No date saved"));
+	_time->setLabel(_("No time saved"));
+	_playtime->setLabel(_("No playtime saved"));
 
 	if (selItem >= 0 && !_list->getSelectedString().empty() && _metaInfoSupport) {
 		SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
@@ -261,15 +262,15 @@
 
 		if (_saveDateSupport) {
 			if (desc.contains("save_date"))
-				_date->setLabel("Date: " + desc.getVal("save_date"));
+				_date->setLabel(_("Date: ") + desc.getVal("save_date"));
 
 			if (desc.contains("save_time"))
-				_time->setLabel("Time: " + desc.getVal("save_time"));
+				_time->setLabel(_("Time: ") + desc.getVal("save_time"));
 		}
 
 		if (_playTimeSupport) {
 			if (desc.contains("play_time"))

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list