aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:44:51 +0000
committerEugene Sandulenko2010-06-15 10:44:51 +0000
commit859212df2523e8b15076d968018dbf98618fd60f (patch)
treee3f7ff62c58c9ac8a762791c0a1801b75fe1f14a
parentdb6673c408865b201808e01ab5db796f2e794058 (diff)
downloadscummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.gz
scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.bz2
scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.zip
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. svn-id: r49759
-rw-r--r--Makefile.common1
-rw-r--r--base/main.cpp37
-rw-r--r--common/error.cpp30
-rwxr-xr-xcommon/messages.cpp543
-rw-r--r--common/module.mk8
-rwxr-xr-xcommon/translation.cpp221
-rwxr-xr-xcommon/translation.h126
-rwxr-xr-xconfigure46
-rw-r--r--engines/dialogs.cpp27
-rw-r--r--gui/GuiManager.cpp18
-rw-r--r--gui/GuiManager.h2
-rw-r--r--gui/KeysDialog.cpp26
-rw-r--r--gui/ThemeEngine.cpp7
-rw-r--r--gui/about.cpp7
-rw-r--r--gui/browser.cpp8
-rw-r--r--gui/error.cpp4
-rw-r--r--gui/launcher.cpp115
-rw-r--r--gui/massadd.cpp17
-rw-r--r--gui/options.cpp195
-rw-r--r--gui/options.h2
-rw-r--r--gui/saveload.cpp31
-rw-r--r--gui/themebrowser.cpp8
-rw-r--r--gui/themes/scummclassic.zipbin52242 -> 52484 bytes
-rw-r--r--gui/themes/scummclassic/classic_layout.stx8
-rw-r--r--gui/themes/scummmodern.zipbin158233 -> 158475 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx8
-rwxr-xr-xpo/POTFILES24
-rw-r--r--po/hu_HU.po321
-rwxr-xr-xpo/module.mk39
-rwxr-xr-xpo/remove-potcdate.sed19
-rw-r--r--po/ru_RU.po784
-rwxr-xr-xpo/scummvm.pot779
-rw-r--r--sound/mididrv.cpp41
-rw-r--r--tools/module.mk1
-rwxr-xr-xtools/po2c280
35 files changed, 3528 insertions, 255 deletions
diff --git a/Makefile.common b/Makefile.common
index 419090a705..14d220f990 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -28,6 +28,7 @@ MODULES += \
engines \
graphics \
common \
+ po
ifdef USE_MT32EMU
MODULES += sound/softsynth/mt32
diff --git a/base/main.cpp b/base/main.cpp
index bfb6611a91..ad6118c905 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -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 @@ static const EnginePlugin *detectPlugin() {
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 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
// 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 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
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 @@ static void setupKeymapper(OSystem &system) {
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 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
// 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 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
// 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 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
} 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.
diff --git a/common/error.cpp b/common/error.cpp
index d51774fd3e..6d1e349287 100644
--- a/common/error.cpp
+++ b/common/error.cpp
@@ -26,6 +26,8 @@
#include "common/error.h"
#include "common/util.h"
+#include "common/translation.h"
+
namespace Common {
/**
@@ -38,24 +40,24 @@ struct ErrorMessage {
};
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 @@ const char *errorToString(Error error) {
}
}
- return "Unknown Error";
+ return _("Unknown Error");
}
} // End of namespace Common
diff --git a/common/messages.cpp b/common/messages.cpp
new file mode 100755
index 0000000000..6a5fc5d813
--- /dev/null
+++ b/common/messages.cpp
@@ -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нtani",
+ /* 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@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@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@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@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;
+}
diff --git a/common/module.mk b/common/module.mk
index 83d30f0a9b..857fb10edf 100644
--- a/common/module.mk
+++ b/common/module.mk
@@ -22,11 +22,19 @@ MODULE_OBJS := \
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
diff --git a/common/translation.cpp b/common/translation.cpp
new file mode 100755
index 0000000000..8301b22ecc
--- /dev/null
+++ b/common/translation.cpp
@@ -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
diff --git a/common/translation.h b/common/translation.h
new file mode 100755
index 0000000000..95deb6bb38
--- /dev/null
+++ b/common/translation.h
@@ -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
diff --git a/configure b/configure
index cb2f690441..56827b3855 100755
--- a/configure
+++ b/configure
@@ -136,6 +136,8 @@ _enable_prof=no
# Default vkeybd/keymapper options
_vkeybd=no
_keymapper=no
+# GUI translation options
+_translation=yes
# Default platform settings
_backend=sdl
_endian=unknown
@@ -676,6 +678,7 @@ Optional Features:
--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 @@ for ac_option in $@; do
--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,6 +2317,47 @@ if test "$_keymapper" = yes ; then
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
#
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 954bc81470..4e4a656cc0 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -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 @@ MainMenuDialog::MainMenuDialog(Engine *engine)
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 @@ ConfigDialog::ConfigDialog(bool subtitleControls)
// 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
}
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index 99fb3be4dc..9f04c382cb 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -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 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled),
// 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 @@ void GuiManager::initKeymap() {
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;
diff --git a/gui/GuiManager.h b/gui/GuiManager.h
index 892d1aa3ac..3187a0ba73 100644
--- a/gui/GuiManager.h
+++ b/gui/GuiManager.h
@@ -71,7 +71,7 @@ public:
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(); }
diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp
index b80dd200bb..65b14f9078 100644
--- a/gui/KeysDialog.cpp
+++ b/gui/KeysDialog.cpp
@@ -40,15 +40,15 @@ enum {
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 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
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 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
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 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
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 @@ void KeysDialog::handleKeyUp(Common::KeyState state) {
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();
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index b472ad0535..03e21153a5 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -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 @@ ThemeEngine::~ThemeEngine() {
* 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
};
diff --git a/gui/about.cpp b/gui/about.cpp
index 8b2f470bf6..a999674751 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -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 @@ AboutDialog::AboutDialog()
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 @@ AboutDialog::AboutDialog()
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) {
diff --git a/gui/browser.cpp b/gui/browser.cpp
index c090742988..86fadf667e 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -30,6 +30,8 @@
#include "common/system.h"
#include "common/algorithm.h"
+#include "common/translation.h"
+
namespace GUI {
enum {
@@ -64,9 +66,9 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_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() {
diff --git a/gui/error.cpp b/gui/error.cpp
index fbe09c5a02..3332eb533a 100644
--- a/gui/error.cpp
+++ b/gui/error.cpp
@@ -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(const char *text) {
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();
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 0f484c5233..3634ef7e3d 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
// 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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 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 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
_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 @@ void EditGameDialog::open() {
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 @@ void EditGameDialog::close() {
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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// 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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// 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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
// 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 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|| 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 @@ LauncherDialog::LauncherDialog()
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 @@ LauncherDialog::LauncherDialog()
_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 @@ LauncherDialog::LauncherDialog()
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,8 +620,12 @@ void LauncherDialog::updateListing() {
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
@@ -652,8 +657,8 @@ void LauncherDialog::addGame() {
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 @@ void LauncherDialog::addGame() {
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 @@ void LauncherDialog::addGame() {
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 @@ void LauncherDialog::addGame() {
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 @@ Common::String addGameToConf(const GameDescriptor &result) {
}
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 @@ void LauncherDialog::loadGame(int item) {
}
} 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 @@ void LauncherDialog::updateButtons() {
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 @@ void LauncherDialog::reflowLayout() {
}
} else {
if (!_searchDesc)
- _searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", "Search:");
+ _searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", _("Search:"));
if (_searchPic) {
removeWidget(_searchPic);
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 266226161a..36efdfdd59 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -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 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
// 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 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
_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 @@ void MassAddDialog::handleTickle() {
// 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);
}
diff --git a/gui/options.cpp b/gui/options.cpp
index 212e90f9f0..9ea3c7a1e8 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -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 @@ enum {
};
#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 @@ OptionsDialog::OptionsDialog(const Common::String &domain, const Common::String
}
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 @@ void OptionsDialog::open() {
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 @@ void OptionsDialog::open() {
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 @@ void OptionsDialog::close() {
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 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
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 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_subSpeedLabel->draw();
break;
case kClearSoundFontCmd:
- _soundFont->setLabel("None");
+ _soundFont->setLabel(_("None"));
_soundFontClearButton->setEnabled(false);
draw();
break;
@@ -522,7 +523,7 @@ void OptionsDialog::setMIDISettingsState(bool enabled) {
_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 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
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::addAudioControls(GuiObject *boss, const Common::String &pref
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 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
// 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::addSubtitleControls(GuiObject *boss, const Common::String &p
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 @@ int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
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 @@ GlobalOptionsDialog::GlobalOptionsDialog()
//
// 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 @@ GlobalOptionsDialog::GlobalOptionsDialog()
//
// 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 @@ void GlobalOptionsDialog::open() {
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 @@ void GlobalOptionsDialog::open() {
#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::open() {
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 @@ void GlobalOptionsDialog::close() {
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::close() {
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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
}
#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 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
}
#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);
diff --git a/gui/options.h b/gui/options.h
index 956f78c18f..de25bfc998 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -184,6 +184,8 @@ protected:
PopUpWidget *_rendererPopUp;
StaticTextWidget *_autosavePeriodPopUpDesc;
PopUpWidget *_autosavePeriodPopUp;
+ StaticTextWidget *_guiLanguagePopUpDesc;
+ PopUpWidget *_guiLanguagePopUp;
};
} // End of namespace GUI
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 8ec4dc4133..85bbd252c7 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -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 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
_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 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
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 @@ void SaveLoadChooser::updateSelection(bool redraw) {
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 @@ void SaveLoadChooser::updateSelection(bool redraw) {
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"))
- _playtime->setLabel("Playtime: " + desc.getVal("play_time"));
+ _playtime->setLabel(_("Playtime: ") + desc.getVal("play_time"));
}
}
@@ -282,7 +283,7 @@ void SaveLoadChooser::updateSelection(bool redraw) {
if (startEditMode) {
_list->startEditMode();
- if (_chooseButton->isEnabled() && _list->getSelectedString() == "Untitled savestate" &&
+ if (_chooseButton->isEnabled() && _list->getSelectedString() == _("Untitled savestate") &&
_list->getSelectionColor() == ThemeEngine::kFontColorAlternate) {
_list->setEditString("");
_list->setEditColor(ThemeEngine::kFontColorNormal);
@@ -349,7 +350,7 @@ void SaveLoadChooser::updateSaveList() {
Common::String trimmedDescription = description;
trimmedDescription.trim();
if (trimmedDescription.empty()) {
- description = "Untitled savestate";
+ description = _("Untitled savestate");
colors.push_back(ThemeEngine::kFontColorAlternate);
} else {
colors.push_back(ThemeEngine::kFontColorNormal);
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp
index 5d0e24394f..43a9ed8d0a 100644
--- a/gui/themebrowser.cpp
+++ b/gui/themebrowser.cpp
@@ -26,6 +26,8 @@
#include "gui/ListWidget.h"
#include "gui/widget.h"
+#include "common/translation.h"
+
namespace GUI {
enum {
@@ -41,7 +43,7 @@ enum {
ThemeBrowser::ThemeBrowser() : Dialog("Browser") {
_fileList = 0;
- new StaticTextWidget(this, "Browser.Headline", "Select a Theme");
+ new StaticTextWidget(this, "Browser.Headline", _("Select a Theme"));
// Add file list
_fileList = new ListWidget(this, "Browser.List");
@@ -51,8 +53,8 @@ ThemeBrowser::ThemeBrowser() : Dialog("Browser") {
_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
// Buttons
- new ButtonWidget(this, "Browser.Cancel", "Cancel", kCloseCmd, 0);
- new ButtonWidget(this, "Browser.Choose", "Choose", kChooseCmd, 0);
+ new ButtonWidget(this, "Browser.Cancel", _("Cancel"), kCloseCmd, 0);
+ new ButtonWidget(this, "Browser.Choose", _("Choose"), kChooseCmd, 0);
}
void ThemeBrowser::open() {
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 67cbbf7990..1a4481376d 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 14f19a7151..b7b07f8845 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -406,6 +406,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'GuiLanguagePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'GuiLanguagePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name='KeysButton'
type='Button'
/>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index b3dc16b67e..64e9a633ff 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 25add37462..699d59b0be 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -419,6 +419,14 @@
type = 'PopUp'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'GuiLanguagePopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'GuiLanguagePopup'
+ type = 'PopUp'
+ />
+ </layout>
<widget name='KeysButton'
type='Button'
/>
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100755
index 0000000000..a8f672d01c
--- /dev/null
+++ b/po/POTFILES
@@ -0,0 +1,24 @@
+#TODO: help_string & usage_string:
+
+gui/about.cpp
+gui/browser.cpp
+gui/error.cpp
+gui/GuiManager.cpp
+gui/KeysDialog.cpp
+gui/launcher.cpp
+gui/massadd.cpp
+gui/options.cpp
+gui/saveload.cpp
+gui/themebrowser.cpp
+gui/ThemeEngine.cpp
+
+base/main.cpp
+
+common/error.cpp
+
+engines/dialogs.cpp
+
+sound/mididrv.cpp
+
+
+#TODO: backends engines tools?
diff --git a/po/hu_HU.po b/po/hu_HU.po
new file mode 100644
index 0000000000..bdc4371212
--- /dev/null
+++ b/po/hu_HU.po
@@ -0,0 +1,321 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2010-06-08 13:39-0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# LANGUAGE translation for ScummVM.
+# Copyright (C) 2009 ScummVM
+# This file is distributed under the same license as the ScummVM package.
+# Alex Bevilacqua <alexbevi@gmail.com>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ScummVM VERSION\n"
+"Report-Msgid-Bugs-To: scummvm-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2009-11-25 07:10-0500\n"
+"PO-Revision-Date: 2009-11-25 07:42-0500\n"
+"Last-Translator: Alex Bevilacqua <alexbevi@gmail.com>\n"
+"Language-Team: Hungarian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gui/options.cpp:71
+msgid "Never"
+msgstr "Soha"
+
+#: gui/options.cpp:71
+msgid "every 5 mins"
+msgstr "5 percenkйnt"
+
+#: gui/options.cpp:71
+msgid "every 10 mins"
+msgstr "10 percenkйnt"
+
+#: gui/options.cpp:71
+msgid "every 15 mins"
+msgstr "15 percenkйnt"
+
+#: gui/options.cpp:71
+msgid "every 30 mins"
+msgstr "30 percenkйnt"
+
+#: gui/options.cpp:73 gui/options.cpp:598 gui/options.cpp:608
+#: gui/options.cpp:838
+msgid "<default>"
+msgstr "<alapйrtelmezett>"
+
+#: gui/options.cpp:73
+msgid "22 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "8 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "11kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "44 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "48 kHz"
+msgstr ""
+
+#: gui/options.cpp:89 gui/options.cpp:95
+msgid "Speech Only"
+msgstr "Csak a beszйd"
+
+#: gui/options.cpp:90
+msgid "Speech and Subtitles"
+msgstr "Beszйd йs a Feliratok"
+
+#: gui/options.cpp:91 gui/options.cpp:97
+msgid "Subtitles Only"
+msgstr "Csak feliratok"
+
+#: gui/options.cpp:96
+msgid "Speech & Subs"
+msgstr "Beszйd s Feliratok"
+
+#: gui/options.cpp:226 gui/options.cpp:382 gui/options.cpp:480
+#: gui/options.cpp:526 gui/options.cpp:661 gui/options.cpp:801
+#: gui/options.cpp:804 gui/options.cpp:882 gui/options.cpp:888
+#: gui/options.cpp:894 gui/options.cpp:902 gui/options.cpp:926
+#: gui/options.cpp:930 gui/options.cpp:936 gui/options.cpp:943
+#: gui/options.cpp:1049
+msgid "None"
+msgstr "Semmi"
+
+#: gui/options.cpp:595
+msgid "Graphics mode:"
+msgstr "Grafikus mуd:"
+
+#: gui/options.cpp:606
+msgid "Render mode:"
+msgstr "Renderelйsi mуd:"
+
+#: gui/options.cpp:616
+msgid "Fullscreen mode"
+msgstr "Teljes kйperny s mуd:"
+
+#: gui/options.cpp:619
+msgid "Aspect ratio correction"
+msgstr "Aspect adag korrekciу"
+
+#: gui/options.cpp:626
+msgid "Music driver:"
+msgstr "Zenei vezet :"
+
+#: gui/options.cpp:637
+msgid "AdLib emulator:"
+msgstr "AdLib vezet :"
+
+#: gui/options.cpp:648
+msgid "Output rate:"
+msgstr "Kimeneti teljesнtmйny:"
+
+#: gui/options.cpp:660
+msgid "SoundFont:"
+msgstr ""
+
+#: gui/options.cpp:665
+msgid "Mixed AdLib/MIDI mode"
+msgstr "Vegyes AdLib/MIDI mуd"
+
+#: gui/options.cpp:668
+msgid "True Roland MT-32 (disable GM emulation)"
+msgstr "Igaz Roland MT-32 (megbйnнt GM emulбciу)"
+
+#: gui/options.cpp:671
+msgid "Enable Roland GS Mode"
+msgstr "Kйpessй Roland GS Mode"
+
+#: gui/options.cpp:674
+msgid "MIDI gain:"
+msgstr "MIDI nyeresйg:"
+
+#: gui/options.cpp:687
+msgid "Text and Speech:"
+msgstr "Szцveg йs beszйd:"
+
+#: gui/options.cpp:691
+msgid "Subtitle speed:"
+msgstr "Felirat sebessйg:"
+
+#: gui/options.cpp:703
+msgid "Music volume:"
+msgstr "Zene mennyisйg:"
+
+#: gui/options.cpp:710
+msgid "Mute All"
+msgstr "Muta Цsszes"
+
+#: gui/options.cpp:713
+msgid "SFX volume:"
+msgstr "SFX mennyisйge"
+
+#: gui/options.cpp:720
+msgid "Speech volume:"
+msgstr "Beszйd mennyisйg:"
+
+#: gui/options.cpp:743
+msgid ""
+"Wrong configuration: Both subtitles and speech are off. Assuming subtitles "
+"only"
+msgstr ""
+
+#: gui/options.cpp:749
+msgid "Graphics"
+msgstr "Grafikбval"
+
+#: gui/options.cpp:749
+msgid "GFX"
+msgstr ""
+
+#: gui/options.cpp:772
+msgid "Audio"
+msgstr "Hang"
+
+#: gui/options.cpp:776
+msgid "Volume"
+msgstr "Volumene"
+
+#: gui/options.cpp:784
+msgid "MIDI"
+msgstr ""
+
+#: gui/options.cpp:790
+msgid "Paths"
+msgstr "Цsvйnyek"
+
+#: gui/options.cpp:797
+msgid "Save Path: "
+msgstr ""
+
+#: gui/options.cpp:800
+msgid "Theme Path:"
+msgstr ""
+
+#: gui/options.cpp:803
+msgid "Extra Path:"
+msgstr "Extra Ъtvonal:"
+
+#: gui/options.cpp:807
+msgid "Plugins Path:"
+msgstr ""
+
+#: gui/options.cpp:812
+msgid "Misc"
+msgstr ""
+
+#: gui/options.cpp:814
+msgid "Theme:"
+msgstr "Tйma:"
+
+#: gui/options.cpp:818
+msgid "GUI Renderer:"
+msgstr "Lekйpez eszkцz GUI:"
+
+#: gui/options.cpp:824
+msgid "Autosave:"
+msgstr "Automatikus mentйs:"
+
+#: gui/options.cpp:832
+msgid "Keys"
+msgstr "Kulcsok"
+
+#: gui/options.cpp:840
+msgid "Angol"
+msgstr ""
+
+#: gui/options.cpp:858
+msgid "Szakнtani"
+msgstr ""
+
+#: gui/options.cpp:859
+msgid "OK"
+msgstr "Igen"
+
+#: gui/options.cpp:995
+msgid "Select directory for savegames"
+msgstr ""
+
+#: gui/options.cpp:1002
+msgid "The chosen directory cannot be written to. Please select another one."
+msgstr ""
+
+#: gui/options.cpp:1011
+msgid "Select directory for GUI themes"
+msgstr ""
+
+#: gui/options.cpp:1021
+msgid "Select directory for extra files"
+msgstr ""
+
+#: gui/options.cpp:1032
+msgid "Select directory for plugins"
+msgstr ""
+
+#: gui/options.cpp:1043
+msgid "Select SoundFont"
+msgstr ""
+
+#: gui/GuiManager.cpp:73
+msgid "Failed to load any GUI theme, aborting"
+msgstr ""
+
+#: base/main.cpp:98
+#, c-format
+msgid "User picked target '%s' (gameid '%s')...\n"
+msgstr ""
+
+#: base/main.cpp:99
+msgid " Looking for a plugin supporting this gameid... "
+msgstr ""
+
+#: base/main.cpp:103
+msgid "failed\n"
+msgstr ""
+
+#: base/main.cpp:104
+#, c-format
+msgid ""
+"%s is an invalid gameid. Use the --list-games option to list supported gameid"
+msgstr ""
+
+#: base/main.cpp:111
+#, c-format
+msgid " Starting '%s'\n"
+msgstr ""
+
+#: base/main.cpp:140
+msgid "Invalid game path"
+msgstr ""
+
+#: base/main.cpp:143
+msgid "Unable to locate game data"
+msgstr ""
+
+#: base/main.cpp:146
+msgid "Unknown error"
+msgstr ""
+
+#: base/main.cpp:149
+#, c-format
+msgid "%s failed to instantiate engine: %s (target '%s', path '%s')"
+msgstr "" \ No newline at end of file
diff --git a/po/module.mk b/po/module.mk
new file mode 100755
index 0000000000..88dde53e87
--- /dev/null
+++ b/po/module.mk
@@ -0,0 +1,39 @@
+POTFILE := po/scummvm.pot
+POFILES := $(wildcard po/*.po)
+
+updatepot:
+ xgettext -f po/POTFILES -d scummvm --c++ -k_ -k_t -k_s -o po/scummvm.pot \
+ "--copyright-holder=ScummVM Team" --package-name=ScummVM \
+ --package-version=$(VERSION) --msgid-bugs-address=scummvm-devel@lists.sf.net -o $(POTFILE)_
+
+ sed -e 's/SOME DESCRIPTIVE TITLE/LANGUAGE translation for ScummVM/' \
+ -e 's/UTF-8/CHARSET/' -e 's/PACKAGE/ScummVM/' $(POTFILE)_ > $(POTFILE).new
+
+ rm $(POTFILE)_
+ if test -f $(POTFILE); then \
+ sed -f po/remove-potcdate.sed < $(POTFILE) > $(POTFILE).1 && \
+ sed -f po/remove-potcdate.sed < $(POTFILE).new > $(POTFILE).2 && \
+ if cmp $(POTFILE).1 $(POTFILE).2 >/dev/null 2>&1; then \
+ rm -f $(POTFILE).new; \
+ else \
+ rm -f $(POTFILE) && \
+ mv -f $(POTFILE).new $(POTFILE); \
+ fi; \
+ rm -f $(POTFILE).1 $(POTFILE).2; \
+ else \
+ mv -f $(POTFILE).new $(POTFILE); \
+ fi;
+
+po/%.po: $(POTFILE)
+ msgmerge $@ $(POTFILE) -o $@.new
+ if cmp $@ $@.new >/dev/null 2>&1; then \
+ rm -f $@.new; \
+ else \
+ mv -f $@.new $@; \
+ fi;
+
+update-translations: updatepot $(POFILES)
+ @$(foreach file, $(POFILES), echo -n $(notdir $(basename $(file)))": ";msgfmt --statistic $(file);)
+ @rm -f messages.mo
+
+.PHONY: updatepot update-translations
diff --git a/po/remove-potcdate.sed b/po/remove-potcdate.sed
new file mode 100755
index 0000000000..2436c49e78
--- /dev/null
+++ b/po/remove-potcdate.sed
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100644
index 0000000000..684226b1cc
--- /dev/null
+++ b/po/ru_RU.po
@@ -0,0 +1,784 @@
+# Russian translation for ScummVM.
+# Copyright (C) 2010 ScummVM
+# This file is distributed under the same license as the ScummVM package.
+# Eugene Sandulenko <sev@scummvm.org>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ScummVM VERSION\n"
+"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
+"POT-Creation-Date: 2010-06-08 17:25+0300\n"
+"PO-Revision-Date: 2010-06-08 08:52-0100\n"
+"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
+"Language-Team: Russian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp1251\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-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"
+
+#: gui/about.cpp:117
+msgid "C2(built on "
+msgstr "C2(собран "
+
+#: gui/about.cpp:125
+msgid "C1Features compiled in:"
+msgstr "C1Включенные в билд опции:"
+
+#: gui/about.cpp:132
+msgid "C1Available engines:"
+msgstr "C1Доступные движки:"
+
+#: gui/browser.cpp:69
+msgid "Go up"
+msgstr "Вверх"
+
+#: gui/browser.cpp:70 gui/KeysDialog.cpp:45 gui/launcher.cpp:265
+#: gui/massadd.cpp:95 gui/options.cpp:859 gui/saveload.cpp:65
+#: gui/saveload.cpp:157 gui/themebrowser.cpp:56 engines/dialogs.cpp:302
+#: gui/options.cpp:861
+msgid "Cancel"
+msgstr "Отмена"
+
+#: gui/browser.cpp:71 gui/themebrowser.cpp:57
+msgid "Choose"
+msgstr "Выбрать"
+
+#: gui/GuiManager.cpp:75
+msgid "Failed to load any GUI theme, aborting"
+msgstr "Не удалось загрузить тему GUI, прекращаю работу"
+
+#: gui/GuiManager.cpp:98
+msgid "Close"
+msgstr "Закрыть"
+
+#: gui/GuiManager.cpp:101
+msgid "Mouse click"
+msgstr "Клик мышью"
+
+#: gui/GuiManager.cpp:104 base/main.cpp:284
+msgid "Display keyboard"
+msgstr "Показать клавиатуру"
+
+#: gui/GuiManager.cpp:107 base/main.cpp:287
+msgid "Remap keys"
+msgstr "Переназначить клавиши"
+
+#: gui/KeysDialog.cpp:43
+msgid "Map"
+msgstr "Назначить"
+
+#: gui/KeysDialog.cpp:44 gui/launcher.cpp:266 gui/launcher.cpp:873
+#: gui/launcher.cpp:877 gui/massadd.cpp:92 gui/options.cpp:860
+#: engines/dialogs.cpp:301 gui/options.cpp:862
+msgid "OK"
+msgstr "OK"
+
+#: gui/KeysDialog.cpp:51
+msgid "Select an action and click 'Map'"
+msgstr "Выберите действие и кликните 'Назначить'"
+
+#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
+#, c-format
+msgid "Associated key : %s"
+msgstr "Назначенная клавиша : %s"
+
+#: gui/KeysDialog.cpp:84 gui/KeysDialog.cpp:106 gui/KeysDialog.cpp:145
+#, c-format
+msgid "Associated key : none"
+msgstr "Назначенная клавиша : нет"
+
+#: gui/KeysDialog.cpp:92
+msgid "Please select an action"
+msgstr "Пожалуйста, выберите действие"
+
+#: gui/KeysDialog.cpp:108
+msgid "Press the key to associate"
+msgstr "Нажмите клавишу для назначения"
+
+#: gui/KeysDialog.cpp:147
+msgid "Choose an action to map"
+msgstr "Выберите действие для назначения"
+
+#: gui/launcher.cpp:170
+msgid "Game"
+msgstr "Игра"
+
+#: gui/launcher.cpp:173
+msgid "ID:"
+msgstr "ID:"
+
+#: gui/launcher.cpp:177
+msgid "Name:"
+msgstr "Название:"
+
+#: gui/launcher.cpp:181 gui/options.cpp:839
+msgid "Language:"
+msgstr "Язык:"
+
+#: gui/launcher.cpp:183 gui/launcher.cpp:193 gui/options.cpp:73
+#: gui/options.cpp:598 gui/options.cpp:608 gui/options.cpp:842
+#: sound/mididrv.cpp:38
+msgid "<default>"
+msgstr "<по умолчанию>"
+
+#: gui/launcher.cpp:191
+msgid "Platform:"
+msgstr "Платформа:"
+
+#: gui/launcher.cpp:203 gui/options.cpp:749 gui/options.cpp:766
+msgid "Graphics"
+msgstr "Графика"
+
+#: gui/launcher.cpp:203 gui/options.cpp:749 gui/options.cpp:766
+msgid "GFX"
+msgstr "Грф"
+
+#: gui/launcher.cpp:205
+msgid "Override global graphic settings"
+msgstr "Перекрыть глобальные установки графики"
+
+#: gui/launcher.cpp:212 gui/options.cpp:772
+msgid "Audio"
+msgstr "Аудио"
+
+#: gui/launcher.cpp:214
+msgid "Override global audio settings"
+msgstr "Перекрыть глобальные установки аудио"
+
+#: gui/launcher.cpp:222 gui/options.cpp:776
+msgid "Volume"
+msgstr "Громкость"
+
+#: gui/launcher.cpp:224
+msgid "Override global volume settings"
+msgstr "Перекрыть глобальные установки громкости"
+
+#: gui/launcher.cpp:231 gui/options.cpp:784
+msgid "MIDI"
+msgstr "MIDI"
+
+#: gui/launcher.cpp:233
+msgid "Override global MIDI settings"
+msgstr "Перекрыть глобальные установки MIDI"
+
+#: gui/launcher.cpp:243 gui/options.cpp:790
+msgid "Paths"
+msgstr "Пути"
+
+#: gui/launcher.cpp:249
+msgid "Game Path:"
+msgstr "Путь к игре: "
+
+#: gui/launcher.cpp:253 gui/options.cpp:803
+msgid "Extra Path:"
+msgstr "Доп. путь:"
+
+#: gui/launcher.cpp:257
+msgid "Save Path:"
+msgstr "Путь сохр.: "
+
+#: gui/launcher.cpp:274 gui/launcher.cpp:353 gui/launcher.cpp:398
+#: gui/options.cpp:226 gui/options.cpp:382 gui/options.cpp:480
+#: gui/options.cpp:526 gui/options.cpp:661 gui/options.cpp:801
+#: gui/options.cpp:804 gui/options.cpp:808 gui/options.cpp:883
+#: gui/options.cpp:889 gui/options.cpp:895 gui/options.cpp:903
+#: gui/options.cpp:927 gui/options.cpp:931 gui/options.cpp:937
+#: gui/options.cpp:944 gui/options.cpp:1050 gui/options.cpp:885
+#: gui/options.cpp:891 gui/options.cpp:897 gui/options.cpp:905
+#: gui/options.cpp:929 gui/options.cpp:933 gui/options.cpp:939
+#: gui/options.cpp:946 gui/options.cpp:1045
+msgid "None"
+msgstr "Не задан"
+
+#: gui/launcher.cpp:279 gui/launcher.cpp:357
+msgid "Default"
+msgstr "По умолчанию"
+
+#: gui/launcher.cpp:391 gui/options.cpp:1044 gui/options.cpp:1039
+msgid "Select SoundFont"
+msgstr "Выберите SoundFont"
+
+#: gui/launcher.cpp:410 gui/launcher.cpp:548
+msgid "Select directory with game data"
+msgstr "Выберите директорию с файлами игры"
+
+#: gui/launcher.cpp:428
+msgid "Select additional game directory"
+msgstr "Выберите дополнительную директорию игры"
+
+#: gui/launcher.cpp:440
+msgid "Select directory for saved games"
+msgstr "Выберите директорию для сохранений"
+
+#: gui/launcher.cpp:459
+msgid "This game ID is already taken. Please choose another one."
+msgstr "Этот ID игры уже используется. Пожалуйста, выберите другой."
+
+#: gui/launcher.cpp:500 engines/dialogs.cpp:113
+msgid "Quit"
+msgstr "Выход"
+
+#: gui/launcher.cpp:501
+msgid "About..."
+msgstr "О программе..."
+
+#: gui/launcher.cpp:502
+msgid "Options..."
+msgstr "Опции..."
+
+#: gui/launcher.cpp:504
+msgid "Start"
+msgstr "Пуск"
+
+#: gui/launcher.cpp:507
+msgid "Load..."
+msgstr "Загр...."
+
+#: gui/launcher.cpp:511 gui/launcher.cpp:990
+msgid "Add Game..."
+msgstr "Нов. игра..."
+
+#: gui/launcher.cpp:513
+msgid "Edit Game..."
+msgstr "Изм. игру..."
+
+#: gui/launcher.cpp:515
+msgid "Remove Game"
+msgstr "Удалить игру"
+
+#: gui/launcher.cpp:526 gui/launcher.cpp:1037
+msgid "Search:"
+msgstr "Поиск:"
+
+#: gui/launcher.cpp:551 engines/dialogs.cpp:117
+msgid "Load game:"
+msgstr "Загрузить игру:"
+
+#: gui/launcher.cpp:551 engines/dialogs.cpp:91 engines/dialogs.cpp:117
+msgid "Load"
+msgstr "Загрузить"
+
+#: gui/launcher.cpp:660
+msgid ""
+"Do you really want to run the mass game detector? This could potentially add "
+"a huge number of games."
+msgstr ""
+"Вы действительно хотите запустить детектор всех игр? Это потенциально может "
+"добавить большое количество игр."
+
+#: gui/launcher.cpp:661 gui/launcher.cpp:810
+msgid "Yes"
+msgstr "Да"
+
+#: gui/launcher.cpp:661 gui/launcher.cpp:810
+msgid "No"
+msgstr "Нет"
+
+#: gui/launcher.cpp:708
+msgid "ScummVM couldn't open the specified directory!"
+msgstr "ScummVM не может открыть указанную директорию!"
+
+#: gui/launcher.cpp:720
+msgid "ScummVM could not find any game in the specified directory!"
+msgstr "ScummVM не может найти игру в указанной директории!"
+
+#: gui/launcher.cpp:734
+msgid "Pick the game:"
+msgstr "Выберите игру:"
+
+#: gui/launcher.cpp:810
+msgid "Do you really want to remove this game configuration?"
+msgstr "Вы действительно хотите удалить установки для этой игры?"
+
+#: gui/launcher.cpp:873
+msgid "This game does not support loading games from the launcher."
+msgstr "Эта игра не поддерживает загрузку сохранений через главное меню."
+
+#: gui/launcher.cpp:877
+msgid "ScummVM could not find any engine capable of running the selected game!"
+msgstr "ScummVM не смог найти движок для запуска выбранной игры!"
+
+#: gui/launcher.cpp:989
+msgid "Mass Add..."
+msgstr "Доб. много..."
+
+#: gui/massadd.cpp:79 gui/massadd.cpp:82
+msgid "... progress ..."
+msgstr "... ищу ..."
+
+#: gui/massadd.cpp:244
+#, c-format
+msgid "Scan complete!"
+msgstr "Поиск закончен!"
+
+#: gui/massadd.cpp:247
+#, c-format
+msgid "Discovered %d new games."
+msgstr "Найдено %d новых игр."
+
+#: gui/massadd.cpp:251
+#, c-format
+msgid "Scanned %d directories ..."
+msgstr "Просмотрено %d директорий ..."
+
+#: gui/massadd.cpp:254
+#, c-format
+msgid "Discovered %d new games ..."
+msgstr "Найдено %d новых игр ..."
+
+#: gui/options.cpp:71
+msgid "Never"
+msgstr "Никогда"
+
+#: gui/options.cpp:71
+msgid "every 5 mins"
+msgstr "каждые 5 минут"
+
+#: gui/options.cpp:71
+msgid "every 10 mins"
+msgstr "каждые 10 минут"
+
+#: gui/options.cpp:71
+msgid "every 15 mins"
+msgstr "каждые 15 минут"
+
+#: gui/options.cpp:71
+msgid "every 30 mins"
+msgstr "каждые 30 минут"
+
+#: gui/options.cpp:73
+msgid "8 kHz"
+msgstr "8 кГц"
+
+#: gui/options.cpp:73
+msgid "11kHz"
+msgstr "11 кГц"
+
+#: gui/options.cpp:73
+msgid "22 kHz"
+msgstr "22 кГц"
+
+#: gui/options.cpp:73
+msgid "44 kHz"
+msgstr "44 кГц"
+
+#: gui/options.cpp:73
+msgid "48 kHz"
+msgstr "48 кГц"
+
+#: gui/options.cpp:89 gui/options.cpp:95
+msgid "Speech Only"
+msgstr "Только озвучка"
+
+#: gui/options.cpp:90
+msgid "Speech and Subtitles"
+msgstr "Озвучка и субтитры"
+
+#: gui/options.cpp:91 gui/options.cpp:97
+msgid "Subtitles Only"
+msgstr "Только субтитры"
+
+#: gui/options.cpp:96
+msgid "Speech & Subs"
+msgstr "Звук и суб."
+
+#: gui/options.cpp:595
+msgid "Graphics mode:"
+msgstr "Графический режим:"
+
+#: gui/options.cpp:606
+msgid "Render mode:"
+msgstr "Режим растрирования:"
+
+#: gui/options.cpp:616
+msgid "Fullscreen mode"
+msgstr "Полноэкранный режим"
+
+#: gui/options.cpp:619
+msgid "Aspect ratio correction"
+msgstr "Коррекция соотношения сторон"
+
+#: gui/options.cpp:626
+msgid "Music driver:"
+msgstr "Драйвер музыки:"
+
+#: gui/options.cpp:637
+msgid "AdLib emulator:"
+msgstr "Эмулятор AdLib:"
+
+#: gui/options.cpp:648
+msgid "Output rate:"
+msgstr "Выходная частота:"
+
+#: gui/options.cpp:660
+msgid "SoundFont:"
+msgstr "SoundFont:"
+
+#: gui/options.cpp:665
+msgid "Mixed AdLib/MIDI mode"
+msgstr "Смешанный режим AdLib/MIDI"
+
+#: gui/options.cpp:668
+msgid "True Roland MT-32 (disable GM emulation)"
+msgstr "Настоящий Roland MT-32 (запретить эмуляцию GM)"
+
+#: gui/options.cpp:671
+msgid "Enable Roland GS Mode"
+msgstr "Включить режим Roland GS"
+
+#: gui/options.cpp:674
+msgid "MIDI gain:"
+msgstr "Усиление MIDI:"
+
+#: gui/options.cpp:687
+msgid "Text and Speech:"
+msgstr "Текст и озвучка:"
+
+#: gui/options.cpp:691
+msgid "Subtitle speed:"
+msgstr "Скорость субтитров:"
+
+#: gui/options.cpp:703
+msgid "Music volume:"
+msgstr "Громкость музыки:"
+
+#: gui/options.cpp:710
+msgid "Mute All"
+msgstr "Выключить всё"
+
+#: gui/options.cpp:713
+msgid "SFX volume:"
+msgstr "Громкость эффектов:"
+
+#: gui/options.cpp:720
+msgid "Speech volume:"
+msgstr "Громкость озвучки:"
+
+#: gui/options.cpp:797
+msgid "Save Path: "
+msgstr "Путь для сохранений: "
+
+#: gui/options.cpp:800
+msgid "Theme Path:"
+msgstr "Путь к темам:"
+
+#: gui/options.cpp:807
+msgid "Plugins Path:"
+msgstr "Путь к плагинам:"
+
+#: gui/options.cpp:812
+msgid "Misc"
+msgstr "Разное"
+
+#: gui/options.cpp:814
+msgid "Theme:"
+msgstr "Тема:"
+
+#: gui/options.cpp:818
+msgid "GUI Renderer:"
+msgstr "Растеризатор GUI:"
+
+#: gui/options.cpp:824
+msgid "Autosave:"
+msgstr "Автосохранение:"
+
+#: gui/options.cpp:832 engines/dialogs.cpp:305
+msgid "Keys"
+msgstr "Клавиши"
+
+#: gui/options.cpp:844
+msgid "English"
+msgstr "English"
+
+#: gui/options.cpp:996 gui/options.cpp:991
+msgid "Select directory for savegames"
+msgstr "Выберите директорию для сохранений"
+
+#: gui/options.cpp:1003 gui/options.cpp:998
+msgid "The chosen directory cannot be written to. Please select another one."
+msgstr "Не могу писать в выбранную директорию. Пожалуйста, укажите другую."
+
+#: gui/options.cpp:1012 gui/options.cpp:1007
+msgid "Select directory for GUI themes"
+msgstr "Выберите директорию для тем GUI"
+
+#: gui/options.cpp:1022 gui/options.cpp:1017
+msgid "Select directory for extra files"
+msgstr "Выберите директорию с дополнительными файлами"
+
+#: gui/options.cpp:1033 gui/options.cpp:1028
+msgid "Select directory for plugins"
+msgstr "Выберите директорию с плагинами"
+
+#: gui/saveload.cpp:60 gui/saveload.cpp:241
+msgid "No date saved"
+msgstr "Дата не записана"
+
+#: gui/saveload.cpp:61 gui/saveload.cpp:242
+msgid "No time saved"
+msgstr "Время не записано"
+
+#: gui/saveload.cpp:62 gui/saveload.cpp:243
+msgid "No playtime saved"
+msgstr "Время игры не записано"
+
+#: gui/saveload.cpp:69 gui/saveload.cpp:157
+msgid "Delete"
+msgstr "Удалить"
+
+#: gui/saveload.cpp:156
+msgid "Do you really want to delete this savegame?"
+msgstr "Вы действительно хотите удалить это сохранение?"
+
+#: gui/saveload.cpp:265
+msgid "Date: "
+msgstr "Дата: "
+
+#: gui/saveload.cpp:268
+msgid "Time: "
+msgstr "Время: "
+
+#: gui/saveload.cpp:273
+msgid "Playtime: "
+msgstr "Время игры: "
+
+#: gui/saveload.cpp:286 gui/saveload.cpp:353
+msgid "Untitled savestate"
+msgstr "Сохранение без имени"
+
+#: gui/themebrowser.cpp:46
+msgid "Select a Theme"
+msgstr "Выберите тему"
+
+#: base/main.cpp:105
+#, c-format
+msgid "User picked target '%s' (gameid '%s')...\n"
+msgstr "Пользователь выбрал цель'%s' (gameid '%s')...\n"
+
+#: base/main.cpp:106
+msgid " Looking for a plugin supporting this gameid... "
+msgstr " Ищу плагин с поддержкой этого gameid... "
+
+#: base/main.cpp:110
+msgid "failed\n"
+msgstr "не удалось\n"
+
+#: base/main.cpp:111
+#, c-format
+msgid ""
+"%s is an invalid gameid. Use the --list-games option to list supported gameid"
+msgstr ""
+"Неверный gameid %s. Используйте опцию --list-games для просмотра списка "
+"поддерживаемых gameid"
+
+#: base/main.cpp:118
+#, c-format
+msgid " Starting '%s'\n"
+msgstr " Запускаю '%s'\n"
+
+#: base/main.cpp:147
+#, c-format
+msgid "%s failed to instantiate engine: %s (target '%s', path '%s')"
+msgstr "%s не смог запустить движок: %s (цель '%s', путь '%s')"
+
+#: base/main.cpp:204
+#, c-format
+msgid "Engine does not support debug level '%s'"
+msgstr "Движок не поддерживает уровень отладки '%s'"
+
+#: base/main.cpp:272
+msgid "Menu"
+msgstr "Меню"
+
+#: base/main.cpp:275
+msgid "Skip"
+msgstr "Пропустить"
+
+#: base/main.cpp:278
+msgid "Pause"
+msgstr "Пауза"
+
+#: base/main.cpp:281
+msgid "Skip line"
+msgstr "Пропустить строку"
+
+#: base/main.cpp:393
+msgid "Error running game:"
+msgstr "Ошибка запуска игры:"
+
+#: base/main.cpp:419 base/main.cpp:420
+msgid "Could not find any engine capable of running the selected game"
+msgstr "Не могу найти движок для запуска выбранной игры"
+
+#: common/error.cpp:43
+msgid "Invalid Path"
+msgstr "Неверный путь"
+
+#: common/error.cpp:44
+msgid "Game Data not found"
+msgstr "Нет файлов игры"
+
+#: common/error.cpp:45
+msgid "Game Id not supported"
+msgstr "Game Id не поддерживается"
+
+#: common/error.cpp:46
+msgid "Unsupported Color Mode"
+msgstr "Неподдерживаемый режим цвета"
+
+#: common/error.cpp:48
+msgid "Read permission denied"
+msgstr "Недостаточно прав для чтения"
+
+#: common/error.cpp:49
+msgid "Write permission denied"
+msgstr "Недостаточно прав для записи"
+
+#: common/error.cpp:52
+msgid "Path not exists"
+msgstr "Путь не найден"
+
+#: common/error.cpp:53
+msgid "Path not a directory"
+msgstr "Путь не является директорией"
+
+#: common/error.cpp:54
+msgid "Path not a file"
+msgstr "Путь не является файлом"
+
+#: common/error.cpp:56
+msgid "Cannot create file"
+msgstr "Не могу создать файл"
+
+#: common/error.cpp:57
+msgid "Reading failed"
+msgstr "Ошибка чтения"
+
+#: common/error.cpp:58
+msgid "Writing data failed"
+msgstr "Ошибка записи данных"
+
+#: common/error.cpp:60 common/error.cpp:71
+msgid "Unknown Error"
+msgstr "Неизвестная ошибка"
+
+#: engines/dialogs.cpp:89
+msgid "Resume"
+msgstr "Продолжить"
+
+#: engines/dialogs.cpp:95 engines/dialogs.cpp:119
+msgid "Save"
+msgstr "Записать"
+
+#: engines/dialogs.cpp:99
+msgid "Options"
+msgstr "Опции"
+
+#: engines/dialogs.cpp:104
+msgid "Help"
+msgstr "Помощь"
+
+#: engines/dialogs.cpp:107
+msgid "About"
+msgstr "О программе"
+
+#: engines/dialogs.cpp:109
+msgid "Return to Launcher"
+msgstr "Вернуться в главное меню"
+
+#: engines/dialogs.cpp:119
+msgid "Save game:"
+msgstr "Сохранить игру: "
+
+#: gui/options.cpp:978
+msgid "You have to restart ScummVM to take the effect."
+msgstr "Вы должны перезапустить ScummVM чтобы применить изменения."
+
+#: gui/ThemeEngine.cpp:333
+msgid "Disabled GFX"
+msgstr "Без графики"
+
+#: gui/ThemeEngine.cpp:334
+msgid "Standard Renderer (16bpp)"
+msgstr "Стандартный растеризатор (16bpp)"
+
+#: gui/ThemeEngine.cpp:336
+msgid "Antialiased Renderer (16bpp)"
+msgstr "Растеризатор со сглаживанием (16bpp)"
+
+#: sound/mididrv.cpp:39
+msgid "No music"
+msgstr "Без музыки"
+
+#: sound/mididrv.cpp:42
+msgid "Windows MIDI"
+msgstr "Windows MIDI"
+
+#: sound/mididrv.cpp:46
+msgid "ALSA"
+msgstr "ALSA"
+
+#: sound/mididrv.cpp:50
+msgid "Atari ST MIDI"
+msgstr "Atars ST MIDI"
+
+#: sound/mididrv.cpp:54
+msgid "SEQ"
+msgstr "SEQ"
+
+#: sound/mididrv.cpp:58
+msgid "DMedia"
+msgstr "DMedia"
+
+#: sound/mididrv.cpp:62
+msgid "CAMD"
+msgstr "CAMD"
+
+#: sound/mididrv.cpp:66
+msgid "CoreAudio"
+msgstr "CoreAudio"
+
+#: sound/mididrv.cpp:68
+msgid "CoreMIDI"
+msgstr "CoreMIDI"
+
+#: sound/mididrv.cpp:73
+msgid "Yamaha Pa1"
+msgstr "Yamaha Pa1"
+
+#: sound/mididrv.cpp:75
+msgid "Tapwave Zodiac"
+msgstr "Tapware Zodiac"
+
+#: sound/mididrv.cpp:80
+msgid "FluidSynth"
+msgstr "FluidSynth"
+
+#: sound/mididrv.cpp:83
+msgid "MT-32 Emulation"
+msgstr "Эмуляция MT-32"
+
+#: sound/mididrv.cpp:87
+msgid "AdLib"
+msgstr "AdLib"
+
+#: sound/mididrv.cpp:88
+msgid "PC Speaker"
+msgstr "PC спикер"
+
+#: sound/mididrv.cpp:89
+msgid "IBM PCjr"
+msgstr "IBM PCjr"
+
+#: sound/mididrv.cpp:90
+msgid "Creative Music System"
+msgstr "Creative Music System"
+
+#: sound/mididrv.cpp:91
+msgid "FM Towns"
+msgstr "FM Towns"
+
+#: sound/mididrv.cpp:93
+msgid "TiMidity"
+msgstr "TiMidity"
diff --git a/po/scummvm.pot b/po/scummvm.pot
new file mode 100755
index 0000000000..77040dd25f
--- /dev/null
+++ b/po/scummvm.pot
@@ -0,0 +1,779 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ScummVM Team
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ScummVM 1.2.0svn\n"
+"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
+"POT-Creation-Date: 2010-06-08 17:25+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: gui/about.cpp:117
+msgid "C2(built on "
+msgstr ""
+
+#: gui/about.cpp:125
+msgid "C1Features compiled in:"
+msgstr ""
+
+#: gui/about.cpp:132
+msgid "C1Available engines:"
+msgstr ""
+
+#: gui/browser.cpp:69
+msgid "Go up"
+msgstr ""
+
+#: gui/browser.cpp:70 gui/KeysDialog.cpp:45 gui/launcher.cpp:265
+#: gui/massadd.cpp:95 gui/options.cpp:859 gui/saveload.cpp:65
+#: gui/saveload.cpp:157 gui/themebrowser.cpp:56 engines/dialogs.cpp:302
+#: gui/options.cpp:861
+msgid "Cancel"
+msgstr ""
+
+#: gui/browser.cpp:71 gui/themebrowser.cpp:57
+msgid "Choose"
+msgstr ""
+
+#: gui/GuiManager.cpp:75
+msgid "Failed to load any GUI theme, aborting"
+msgstr ""
+
+#: gui/GuiManager.cpp:98
+msgid "Close"
+msgstr ""
+
+#: gui/GuiManager.cpp:101
+msgid "Mouse click"
+msgstr ""
+
+#: gui/GuiManager.cpp:104 base/main.cpp:284
+msgid "Display keyboard"
+msgstr ""
+
+#: gui/GuiManager.cpp:107 base/main.cpp:287
+msgid "Remap keys"
+msgstr ""
+
+#: gui/KeysDialog.cpp:43
+msgid "Map"
+msgstr ""
+
+#: gui/KeysDialog.cpp:44 gui/launcher.cpp:266 gui/launcher.cpp:873
+#: gui/launcher.cpp:877 gui/massadd.cpp:92 gui/options.cpp:860
+#: engines/dialogs.cpp:301 gui/options.cpp:862
+msgid "OK"
+msgstr ""
+
+#: gui/KeysDialog.cpp:51
+msgid "Select an action and click 'Map'"
+msgstr ""
+
+#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
+#, c-format
+msgid "Associated key : %s"
+msgstr ""
+
+#: gui/KeysDialog.cpp:84 gui/KeysDialog.cpp:106 gui/KeysDialog.cpp:145
+#, c-format
+msgid "Associated key : none"
+msgstr ""
+
+#: gui/KeysDialog.cpp:92
+msgid "Please select an action"
+msgstr ""
+
+#: gui/KeysDialog.cpp:108
+msgid "Press the key to associate"
+msgstr ""
+
+#: gui/KeysDialog.cpp:147
+msgid "Choose an action to map"
+msgstr ""
+
+#: gui/launcher.cpp:170
+msgid "Game"
+msgstr ""
+
+#: gui/launcher.cpp:173
+msgid "ID:"
+msgstr ""
+
+#: gui/launcher.cpp:177
+msgid "Name:"
+msgstr ""
+
+#: gui/launcher.cpp:181 gui/options.cpp:839
+msgid "Language:"
+msgstr ""
+
+#: gui/launcher.cpp:183 gui/launcher.cpp:193 gui/options.cpp:73
+#: gui/options.cpp:598 gui/options.cpp:608 gui/options.cpp:842
+#: sound/mididrv.cpp:38
+msgid "<default>"
+msgstr ""
+
+#: gui/launcher.cpp:191
+msgid "Platform:"
+msgstr ""
+
+#: gui/launcher.cpp:203 gui/options.cpp:749 gui/options.cpp:766
+msgid "Graphics"
+msgstr ""
+
+#: gui/launcher.cpp:203 gui/options.cpp:749 gui/options.cpp:766
+msgid "GFX"
+msgstr ""
+
+#: gui/launcher.cpp:205
+msgid "Override global graphic settings"
+msgstr ""
+
+#: gui/launcher.cpp:212 gui/options.cpp:772
+msgid "Audio"
+msgstr ""
+
+#: gui/launcher.cpp:214
+msgid "Override global audio settings"
+msgstr ""
+
+#: gui/launcher.cpp:222 gui/options.cpp:776
+msgid "Volume"
+msgstr ""
+
+#: gui/launcher.cpp:224
+msgid "Override global volume settings"
+msgstr ""
+
+#: gui/launcher.cpp:231 gui/options.cpp:784
+msgid "MIDI"
+msgstr ""
+
+#: gui/launcher.cpp:233
+msgid "Override global MIDI settings"
+msgstr ""
+
+#: gui/launcher.cpp:243 gui/options.cpp:790
+msgid "Paths"
+msgstr ""
+
+#: gui/launcher.cpp:249
+msgid "Game Path:"
+msgstr ""
+
+#: gui/launcher.cpp:253 gui/options.cpp:803
+msgid "Extra Path:"
+msgstr ""
+
+#: gui/launcher.cpp:257
+msgid "Save Path:"
+msgstr ""
+
+#: gui/launcher.cpp:274 gui/launcher.cpp:353 gui/launcher.cpp:398
+#: gui/options.cpp:226 gui/options.cpp:382 gui/options.cpp:480
+#: gui/options.cpp:526 gui/options.cpp:661 gui/options.cpp:801
+#: gui/options.cpp:804 gui/options.cpp:808 gui/options.cpp:883
+#: gui/options.cpp:889 gui/options.cpp:895 gui/options.cpp:903
+#: gui/options.cpp:927 gui/options.cpp:931 gui/options.cpp:937
+#: gui/options.cpp:944 gui/options.cpp:1050 gui/options.cpp:885
+#: gui/options.cpp:891 gui/options.cpp:897 gui/options.cpp:905
+#: gui/options.cpp:929 gui/options.cpp:933 gui/options.cpp:939
+#: gui/options.cpp:946 gui/options.cpp:1045
+msgid "None"
+msgstr ""
+
+#: gui/launcher.cpp:279 gui/launcher.cpp:357
+msgid "Default"
+msgstr ""
+
+#: gui/launcher.cpp:391 gui/options.cpp:1044 gui/options.cpp:1039
+msgid "Select SoundFont"
+msgstr ""
+
+#: gui/launcher.cpp:410 gui/launcher.cpp:548
+msgid "Select directory with game data"
+msgstr ""
+
+#: gui/launcher.cpp:428
+msgid "Select additional game directory"
+msgstr ""
+
+#: gui/launcher.cpp:440
+msgid "Select directory for saved games"
+msgstr ""
+
+#: gui/launcher.cpp:459
+msgid "This game ID is already taken. Please choose another one."
+msgstr ""
+
+#: gui/launcher.cpp:500 engines/dialogs.cpp:113
+msgid "Quit"
+msgstr ""
+
+#: gui/launcher.cpp:501
+msgid "About..."
+msgstr ""
+
+#: gui/launcher.cpp:502
+msgid "Options..."
+msgstr ""
+
+#: gui/launcher.cpp:504
+msgid "Start"
+msgstr ""
+
+#: gui/launcher.cpp:507
+msgid "Load..."
+msgstr ""
+
+#: gui/launcher.cpp:511 gui/launcher.cpp:990
+msgid "Add Game..."
+msgstr ""
+
+#: gui/launcher.cpp:513
+msgid "Edit Game..."
+msgstr ""
+
+#: gui/launcher.cpp:515
+msgid "Remove Game"
+msgstr ""
+
+#: gui/launcher.cpp:526 gui/launcher.cpp:1037
+msgid "Search:"
+msgstr ""
+
+#: gui/launcher.cpp:551 engines/dialogs.cpp:117
+msgid "Load game:"
+msgstr ""
+
+#: gui/launcher.cpp:551 engines/dialogs.cpp:91 engines/dialogs.cpp:117
+msgid "Load"
+msgstr ""
+
+#: gui/launcher.cpp:660
+msgid ""
+"Do you really want to run the mass game detector? This could potentially add "
+"a huge number of games."
+msgstr ""
+
+#: gui/launcher.cpp:661 gui/launcher.cpp:810
+msgid "Yes"
+msgstr ""
+
+#: gui/launcher.cpp:661 gui/launcher.cpp:810
+msgid "No"
+msgstr ""
+
+#: gui/launcher.cpp:708
+msgid "ScummVM couldn't open the specified directory!"
+msgstr ""
+
+#: gui/launcher.cpp:720
+msgid "ScummVM could not find any game in the specified directory!"
+msgstr ""
+
+#: gui/launcher.cpp:734
+msgid "Pick the game:"
+msgstr ""
+
+#: gui/launcher.cpp:810
+msgid "Do you really want to remove this game configuration?"
+msgstr ""
+
+#: gui/launcher.cpp:873
+msgid "This game does not support loading games from the launcher."
+msgstr ""
+
+#: gui/launcher.cpp:877
+msgid "ScummVM could not find any engine capable of running the selected game!"
+msgstr ""
+
+#: gui/launcher.cpp:989
+msgid "Mass Add..."
+msgstr ""
+
+#: gui/massadd.cpp:79 gui/massadd.cpp:82
+msgid "... progress ..."
+msgstr ""
+
+#: gui/massadd.cpp:244
+#, c-format
+msgid "Scan complete!"
+msgstr ""
+
+#: gui/massadd.cpp:247
+#, c-format
+msgid "Discovered %d new games."
+msgstr ""
+
+#: gui/massadd.cpp:251
+#, c-format
+msgid "Scanned %d directories ..."
+msgstr ""
+
+#: gui/massadd.cpp:254
+#, c-format
+msgid "Discovered %d new games ..."
+msgstr ""
+
+#: gui/options.cpp:71
+msgid "Never"
+msgstr ""
+
+#: gui/options.cpp:71
+msgid "every 5 mins"
+msgstr ""
+
+#: gui/options.cpp:71
+msgid "every 10 mins"
+msgstr ""
+
+#: gui/options.cpp:71
+msgid "every 15 mins"
+msgstr ""
+
+#: gui/options.cpp:71
+msgid "every 30 mins"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "8 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "11kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "22 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "44 kHz"
+msgstr ""
+
+#: gui/options.cpp:73
+msgid "48 kHz"
+msgstr ""
+
+#: gui/options.cpp:89 gui/options.cpp:95
+msgid "Speech Only"
+msgstr ""
+
+#: gui/options.cpp:90
+msgid "Speech and Subtitles"
+msgstr ""
+
+#: gui/options.cpp:91 gui/options.cpp:97
+msgid "Subtitles Only"
+msgstr ""
+
+#: gui/options.cpp:96
+msgid "Speech & Subs"
+msgstr ""
+
+#: gui/options.cpp:595
+msgid "Graphics mode:"
+msgstr ""
+
+#: gui/options.cpp:606
+msgid "Render mode:"
+msgstr ""
+
+#: gui/options.cpp:616
+msgid "Fullscreen mode"
+msgstr ""
+
+#: gui/options.cpp:619
+msgid "Aspect ratio correction"
+msgstr ""
+
+#: gui/options.cpp:626
+msgid "Music driver:"
+msgstr ""
+
+#: gui/options.cpp:637
+msgid "AdLib emulator:"
+msgstr ""
+
+#: gui/options.cpp:648
+msgid "Output rate:"
+msgstr ""
+
+#: gui/options.cpp:660
+msgid "SoundFont:"
+msgstr ""
+
+#: gui/options.cpp:665
+msgid "Mixed AdLib/MIDI mode"
+msgstr ""
+
+#: gui/options.cpp:668
+msgid "True Roland MT-32 (disable GM emulation)"
+msgstr ""
+
+#: gui/options.cpp:671
+msgid "Enable Roland GS Mode"
+msgstr ""
+
+#: gui/options.cpp:674
+msgid "MIDI gain:"
+msgstr ""
+
+#: gui/options.cpp:687
+msgid "Text and Speech:"
+msgstr ""
+
+#: gui/options.cpp:691
+msgid "Subtitle speed:"
+msgstr ""
+
+#: gui/options.cpp:703
+msgid "Music volume:"
+msgstr ""
+
+#: gui/options.cpp:710
+msgid "Mute All"
+msgstr ""
+
+#: gui/options.cpp:713
+msgid "SFX volume:"
+msgstr ""
+
+#: gui/options.cpp:720
+msgid "Speech volume:"
+msgstr ""
+
+#: gui/options.cpp:797
+msgid "Save Path: "
+msgstr ""
+
+#: gui/options.cpp:800
+msgid "Theme Path:"
+msgstr ""
+
+#: gui/options.cpp:807
+msgid "Plugins Path:"
+msgstr ""
+
+#: gui/options.cpp:812
+msgid "Misc"
+msgstr ""
+
+#: gui/options.cpp:814
+msgid "Theme:"
+msgstr ""
+
+#: gui/options.cpp:818
+msgid "GUI Renderer:"
+msgstr ""
+
+#: gui/options.cpp:824
+msgid "Autosave:"
+msgstr ""
+
+#: gui/options.cpp:832 engines/dialogs.cpp:305
+msgid "Keys"
+msgstr ""
+
+#: gui/options.cpp:844
+msgid "English"
+msgstr ""
+
+#: gui/options.cpp:996 gui/options.cpp:991
+msgid "Select directory for savegames"
+msgstr ""
+
+#: gui/options.cpp:1003 gui/options.cpp:998
+msgid "The chosen directory cannot be written to. Please select another one."
+msgstr ""
+
+#: gui/options.cpp:1012 gui/options.cpp:1007
+msgid "Select directory for GUI themes"
+msgstr ""
+
+#: gui/options.cpp:1022 gui/options.cpp:1017
+msgid "Select directory for extra files"
+msgstr ""
+
+#: gui/options.cpp:1033 gui/options.cpp:1028
+msgid "Select directory for plugins"
+msgstr ""
+
+#: gui/saveload.cpp:60 gui/saveload.cpp:241
+msgid "No date saved"
+msgstr ""
+
+#: gui/saveload.cpp:61 gui/saveload.cpp:242
+msgid "No time saved"
+msgstr ""
+
+#: gui/saveload.cpp:62 gui/saveload.cpp:243
+msgid "No playtime saved"
+msgstr ""
+
+#: gui/saveload.cpp:69 gui/saveload.cpp:157
+msgid "Delete"
+msgstr ""
+
+#: gui/saveload.cpp:156
+msgid "Do you really want to delete this savegame?"
+msgstr ""
+
+#: gui/saveload.cpp:265
+msgid "Date: "
+msgstr ""
+
+#: gui/saveload.cpp:268
+msgid "Time: "
+msgstr ""
+
+#: gui/saveload.cpp:273
+msgid "Playtime: "
+msgstr ""
+
+#: gui/saveload.cpp:286 gui/saveload.cpp:353
+msgid "Untitled savestate"
+msgstr ""
+
+#: gui/themebrowser.cpp:46
+msgid "Select a Theme"
+msgstr ""
+
+#: base/main.cpp:105
+#, c-format
+msgid "User picked target '%s' (gameid '%s')...\n"
+msgstr ""
+
+#: base/main.cpp:106
+msgid " Looking for a plugin supporting this gameid... "
+msgstr ""
+
+#: base/main.cpp:110
+msgid "failed\n"
+msgstr ""
+
+#: base/main.cpp:111
+#, c-format
+msgid ""
+"%s is an invalid gameid. Use the --list-games option to list supported gameid"
+msgstr ""
+
+#: base/main.cpp:118
+#, c-format
+msgid " Starting '%s'\n"
+msgstr ""
+
+#: base/main.cpp:147
+#, c-format
+msgid "%s failed to instantiate engine: %s (target '%s', path '%s')"
+msgstr ""
+
+#: base/main.cpp:204
+#, c-format
+msgid "Engine does not support debug level '%s'"
+msgstr ""
+
+#: base/main.cpp:272
+msgid "Menu"
+msgstr ""
+
+#: base/main.cpp:275
+msgid "Skip"
+msgstr ""
+
+#: base/main.cpp:278
+msgid "Pause"
+msgstr ""
+
+#: base/main.cpp:281
+msgid "Skip line"
+msgstr ""
+
+#: base/main.cpp:393
+msgid "Error running game:"
+msgstr ""
+
+#: base/main.cpp:419 base/main.cpp:420
+msgid "Could not find any engine capable of running the selected game"
+msgstr ""
+
+#: common/error.cpp:43
+msgid "Invalid Path"
+msgstr ""
+
+#: common/error.cpp:44
+msgid "Game Data not found"
+msgstr ""
+
+#: common/error.cpp:45
+msgid "Game Id not supported"
+msgstr ""
+
+#: common/error.cpp:46
+msgid "Unsupported Color Mode"
+msgstr ""
+
+#: common/error.cpp:48
+msgid "Read permission denied"
+msgstr ""
+
+#: common/error.cpp:49
+msgid "Write permission denied"
+msgstr ""
+
+#: common/error.cpp:52
+msgid "Path not exists"
+msgstr ""
+
+#: common/error.cpp:53
+msgid "Path not a directory"
+msgstr ""
+
+#: common/error.cpp:54
+msgid "Path not a file"
+msgstr ""
+
+#: common/error.cpp:56
+msgid "Cannot create file"
+msgstr ""
+
+#: common/error.cpp:57
+msgid "Reading failed"
+msgstr ""
+
+#: common/error.cpp:58
+msgid "Writing data failed"
+msgstr ""
+
+#: common/error.cpp:60 common/error.cpp:71
+msgid "Unknown Error"
+msgstr ""
+
+#: engines/dialogs.cpp:89
+msgid "Resume"
+msgstr ""
+
+#: engines/dialogs.cpp:95 engines/dialogs.cpp:119
+msgid "Save"
+msgstr ""
+
+#: engines/dialogs.cpp:99
+msgid "Options"
+msgstr ""
+
+#: engines/dialogs.cpp:104
+msgid "Help"
+msgstr ""
+
+#: engines/dialogs.cpp:107
+msgid "About"
+msgstr ""
+
+#: engines/dialogs.cpp:109
+msgid "Return to Launcher"
+msgstr ""
+
+#: engines/dialogs.cpp:119
+msgid "Save game:"
+msgstr ""
+
+#: gui/options.cpp:978
+msgid "You have to restart ScummVM to take the effect."
+msgstr ""
+
+#: gui/ThemeEngine.cpp:333
+msgid "Disabled GFX"
+msgstr ""
+
+#: gui/ThemeEngine.cpp:334
+msgid "Standard Renderer (16bpp)"
+msgstr ""
+
+#: gui/ThemeEngine.cpp:336
+msgid "Antialiased Renderer (16bpp)"
+msgstr ""
+
+#: sound/mididrv.cpp:39
+msgid "No music"
+msgstr ""
+
+#: sound/mididrv.cpp:42
+msgid "Windows MIDI"
+msgstr ""
+
+#: sound/mididrv.cpp:46
+msgid "ALSA"
+msgstr ""
+
+#: sound/mididrv.cpp:50
+msgid "Atari ST MIDI"
+msgstr ""
+
+#: sound/mididrv.cpp:54
+msgid "SEQ"
+msgstr ""
+
+#: sound/mididrv.cpp:58
+msgid "DMedia"
+msgstr ""
+
+#: sound/mididrv.cpp:62
+msgid "CAMD"
+msgstr ""
+
+#: sound/mididrv.cpp:66
+msgid "CoreAudio"
+msgstr ""
+
+#: sound/mididrv.cpp:68
+msgid "CoreMIDI"
+msgstr ""
+
+#: sound/mididrv.cpp:73
+msgid "Yamaha Pa1"
+msgstr ""
+
+#: sound/mididrv.cpp:75
+msgid "Tapwave Zodiac"
+msgstr ""
+
+#: sound/mididrv.cpp:80
+msgid "FluidSynth"
+msgstr ""
+
+#: sound/mididrv.cpp:83
+msgid "MT-32 Emulation"
+msgstr ""
+
+#: sound/mididrv.cpp:87
+msgid "AdLib"
+msgstr ""
+
+#: sound/mididrv.cpp:88
+msgid "PC Speaker"
+msgstr ""
+
+#: sound/mididrv.cpp:89
+msgid "IBM PCjr"
+msgstr ""
+
+#: sound/mididrv.cpp:90
+msgid "Creative Music System"
+msgstr ""
+
+#: sound/mididrv.cpp:91
+msgid "FM Towns"
+msgstr ""
+
+#: sound/mididrv.cpp:93
+msgid "TiMidity"
+msgstr ""
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index a9a782184e..e34f5a9705 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -27,6 +27,7 @@
#include "common/config-manager.h"
#include "common/str.h"
#include "common/system.h"
+#include "common/translation.h"
#include "common/util.h"
#include "sound/mididrv.h"
@@ -35,62 +36,62 @@ static const MidiDriverDescription s_musicDrivers[] = {
// The flags for the "auto" & "null" drivers indicate that they are anything
// you want it to be.
- {"auto", "<default>", MD_AUTO, MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS},
- {"null", "No music", MD_NULL, MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS},
+ {"auto", _s("<default>"), MD_AUTO, MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS},
+ {"null", _s("No music"), MD_NULL, MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS},
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
- {"windows", "Windows MIDI", MD_WINDOWS, MDT_MIDI},
+ {"windows", _s("Windows MIDI"), MD_WINDOWS, MDT_MIDI},
#endif
#if defined(UNIX) && defined(USE_ALSA)
- {"alsa", "ALSA", MD_ALSA, MDT_MIDI},
+ {"alsa", _s("ALSA"), MD_ALSA, MDT_MIDI},
#endif
#if defined(__MINT__)
- {"stmidi", "Atari ST MIDI", MD_STMIDI, MDT_MIDI},
+ {"stmidi", _s("Atari ST MIDI"), MD_STMIDI, MDT_MIDI},
#endif
#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) && !defined(__MINT__)
- {"seq", "SEQ", MD_SEQ, MDT_MIDI},
+ {"seq", _s("SEQ"), MD_SEQ, MDT_MIDI},
#endif
#if defined(IRIX)
- {"dmedia", "DMedia", MD_DMEDIA, MDT_MIDI},
+ {"dmedia", _s("DMedia"), MD_DMEDIA, MDT_MIDI},
#endif
#if defined(__amigaos4__)
- {"camd", "CAMD", MD_CAMD, MDT_MIDI},
+ {"camd", _s("CAMD"), MD_CAMD, MDT_MIDI},
#endif
#if defined(MACOSX)
- {"core", "CoreAudio", MD_COREAUDIO, MDT_MIDI},
+ {"core", _s("CoreAudio"), MD_COREAUDIO, MDT_MIDI},
// {"coreaudio", "CoreAudio", MD_COREAUDIO, MDT_MIDI},
- {"coremidi", "CoreMIDI", MD_COREMIDI, MDT_MIDI},
+ {"coremidi", _s("CoreMIDI"), MD_COREMIDI, MDT_MIDI},
#endif
#if defined(PALMOS_MODE)
# if defined(COMPILE_CLIE)
- {"ypa1", "Yamaha Pa1", MD_YPA1, MDT_MIDI},
+ {"ypa1", _s("Yamaha Pa1"), MD_YPA1, MDT_MIDI},
# elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM))
- {"zodiac", "Tapwave Zodiac", MD_ZODIAC, MDT_MIDI},
+ {"zodiac", _s("Tapwave Zodiac"), MD_ZODIAC, MDT_MIDI},
# endif
#endif
#ifdef USE_FLUIDSYNTH
- {"fluidsynth", "FluidSynth", MD_FLUIDSYNTH, MDT_MIDI},
+ {"fluidsynth", _s("FluidSynth"), MD_FLUIDSYNTH, MDT_MIDI},
#endif
#ifdef USE_MT32EMU
- {"mt32", "MT-32 Emulation", MD_MT32, MDT_MIDI},
+ {"mt32", _s("MT-32 Emulation"), MD_MT32, MDT_MIDI},
#endif
// The flags for the "adlib" driver indicates that it can do AdLib and MIDI.
- {"adlib", "AdLib", MD_ADLIB, MDT_ADLIB},
- {"pcspk", "PC Speaker", MD_PCSPK, MDT_PCSPK},
- {"pcjr", "IBM PCjr", MD_PCJR, MDT_PCSPK},
- {"cms", "Creative Music System", MD_CMS, MDT_CMS},
- {"towns", "FM Towns", MD_TOWNS, MDT_TOWNS},
+ {"adlib", _s("AdLib"), MD_ADLIB, MDT_ADLIB},
+ {"pcspk", _s("PC Speaker"), MD_PCSPK, MDT_PCSPK},
+ {"pcjr", _s("IBM PCjr"), MD_PCJR, MDT_PCSPK},
+ {"cms", _s("Creative Music System"), MD_CMS, MDT_CMS},
+ {"towns", _s("FM Towns"), MD_TOWNS, MDT_TOWNS},
#if defined(UNIX)
- {"timidity", "TiMidity", MD_TIMIDITY, MDT_MIDI},
+ {"timidity", _s("TiMidity"), MD_TIMIDITY, MDT_MIDI},
#endif
{0, 0, MD_NULL, MDT_NONE}
diff --git a/tools/module.mk b/tools/module.mk
index 896a2e504b..2c62e427ea 100644
--- a/tools/module.mk
+++ b/tools/module.mk
@@ -65,7 +65,6 @@ md5scumm: tools/md5table$(EXEEXT)
tools/md5table$(EXEEXT) --c++ < $(srcdir)/tools/scumm-md5.txt > $(srcdir)/engines/scumm/scumm-md5.h
cp $(srcdir)/tools/scumm-md5.txt $(srcdir)/../../web/trunk/data/scumm-md5.txt
-
#
# Rules which automatically and implicitly rebuild the credits and
# MD5 tables when needed.
diff --git a/tools/po2c b/tools/po2c
new file mode 100755
index 0000000000..ac1744aa2c
--- /dev/null
+++ b/tools/po2c
@@ -0,0 +1,280 @@
+#!/usr/bin/perl
+
+#
+# po2c - Converts .po files to C code
+#
+# Copyright (C) 2004 Angel Ortega <angel@triptico.com>
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# http://www.triptico.com
+#
+
+$VERSION = "1.0.2";
+
+if(scalar(@ARGV) == 0)
+{
+ print "Usage: po2c {po file[s]}\n";
+ exit 1;
+}
+
+%msgs = ();
+%msgids = ();
+
+# stage 1: loading
+
+# arguments are .po files
+foreach my $f (@ARGV)
+{
+ my ($lang);
+ my ($langDesc);
+
+ next unless(($lang) = ($f =~ /([^\/]+)\.po$/));
+
+ if(open F, $f)
+ {
+ my ($msgid, $val, %a);
+
+ while(<F>)
+ {
+ chomp;
+
+ # ignore blank lines or comments
+ next if /^$/ or /^#/;
+
+ if(/^msgid\s+\"(.*)\"\s*$/)
+ {
+ # store previous msgid
+ if(defined($msgid))
+ {
+ $a{$msgid} = $val;
+ $msgids{$msgid} ++;
+ }
+
+ # start of msgid
+ $val = $1;
+ }
+ elsif(/^msgstr\s+\"(.*)\"\s*$/)
+ {
+ # store previous msgid
+ $msgid = $val;
+
+ # start of msgstr
+ $val = $1;
+ }
+ elsif(/^\"(.*)\"\s*$/)
+ {
+ # add to current value
+ $val .= $1;
+ }
+ }
+
+ # store previous msgid
+ if(defined($msgid))
+ {
+ $a{$msgid} = $val;
+ $msgids{$msgid} ++;
+ }
+
+ close F;
+
+ # add to the global message pool
+ $msgs{$lang} = \%a;
+ }
+}
+
+# stage 2: convert the data
+
+# stores all sorted msgids into @msgids
+@msgids = sort(keys(%msgids));
+
+# travels again, storing indexes into %msgids
+for(my $n = 0;$n < scalar(@msgids);$n++)
+{
+ $msgids{$msgids[$n]} = $n;
+}
+
+# stage 3: dump as C code
+
+print "/* generated by po2c $VERSION - Do not modify */\n\n";
+print "#include <stdio.h>\n";
+print "#include <string.h>\n\n";
+
+# dump first the msgid array
+print "static const char * _po2c_msgids[] = {\n";
+
+for(my $n = 0;$n < scalar(@msgids);$n++)
+{
+ print "\t/* $n */ \"" . $msgids[$n] . "\",\n";
+}
+
+print "\tNULL\n};\n\n";
+
+# dump the lang structure
+print "struct _po2c_msg {\n";
+print "\tint msgid;\n";
+print "\tconst char * msgstr;\n";
+print "};\n\n";
+
+# dump now each language
+
+foreach my $l (keys(%msgs))
+{
+ print "static struct _po2c_msg _po2c_lang_${l}\[\] = {\n";
+
+ # get the translation table for the language $l
+ my ($m) = $msgs{$l};
+
+# while (my ($msgstr, $msgid) = each (%$m))
+ foreach my $msgid (sort(keys(%$m)))
+ {
+ my ($msgstr) = "";
+
+ # make it 7-bit safe
+ foreach $c (split(//, $m->{$msgid})) {
+ if (ord($c) > 0x7f) {
+ $msgstr .= sprintf("\\%o", ord($c));
+ } else {
+ $msgstr .= $c;
+ }
+ }
+
+ print "\t{ " . $msgids{$msgid} . ", \"" . $msgstr . "\" },\n"
+ if $msgstr;
+ }
+
+ print "\t{ -1, NULL }\n};\n\n";
+}
+
+# finally, dump the languages
+
+print "static struct {\n";
+print "\tconst char * lang;\n";
+print "\tconst char * charset;\n";
+print "\tstruct _po2c_msg * msgs;\n";
+print "} _po2c_langs[] = {\n";
+
+foreach my $l (keys(%msgs))
+{
+ $header = $msgs{$l}->{""};
+ $header =~ /charset=([^\\]+)/;
+ $charset = $1;
+ print "\t{ \"" . $l . "\", \"" . $charset . "\", _po2c_lang_${l} },\n";
+}
+
+print "\t{ NULL, NULL, NULL }\n};\n\n";
+
+print "/* code */\n";
+print << 'EOF';
+
+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;
+}
+EOF
+
+exit 0;