Ticket #8695: translation-marked-messages.patch
File translation-marked-messages.patch, 100.3 KB (added by , 17 years ago) |
---|
-
gui/newgui.cpp
34 34 #include "gui/ThemeClassic.h" 35 35 36 36 #include "common/config-manager.h" 37 #include "common/translation.h" 37 38 38 39 DECLARE_SINGLETON(GUI::NewGui); 39 40 … … 59 60 void GuiObject::reflowLayout() { 60 61 if (!_name.empty()) { 61 62 if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR) 62 error( "Undefined variable %s.x", _name.c_str());63 error(_t("Undefined variable %s.x"), _name.c_str()); 63 64 if ((_y = g_gui.evaluator()->getVar(_name + ".y")) == EVAL_UNDEF_VAR) 64 error( "Undefined variable %s.y", _name.c_str());65 error(_t("Undefined variable %s.y"), _name.c_str()); 65 66 _w = g_gui.evaluator()->getVar(_name + ".w"); 66 67 _h = g_gui.evaluator()->getVar(_name + ".h"); 67 68 68 69 if (_x < 0) 69 error( "Widget <%s> has x < 0", _name.c_str());70 error(_t("Widget <%s> has x < 0"), _name.c_str()); 70 71 if (_x >= g_system->getOverlayWidth()) 71 error( "Widget <%s> has x > %d", _name.c_str(), g_system->getOverlayWidth());72 error(_t("Widget <%s> has x > %d"), _name.c_str(), g_system->getOverlayWidth()); 72 73 if (_x + _w > g_system->getOverlayWidth()) 73 error( "Widget <%s> has x + w > %d (%d)", _name.c_str(), g_system->getOverlayWidth(), _x + _w);74 error(_t("Widget <%s> has x + w > %d (%d)"), _name.c_str(), g_system->getOverlayWidth(), _x + _w); 74 75 if (_y < 0) 75 error( "Widget <%s> has y < 0", _name.c_str());76 error(_t("Widget <%s> has y < 0"), _name.c_str()); 76 77 if (_y >= g_system->getOverlayWidth()) 77 error( "Widget <%s> has y > %d", _name.c_str(), g_system->getOverlayHeight());78 error(_t("Widget <%s> has y > %d"), _name.c_str(), g_system->getOverlayHeight()); 78 79 if (_y + _h > g_system->getOverlayWidth()) 79 error( "Widget <%s> has y + h > %d (%d)", _name.c_str(), g_system->getOverlayHeight(), _y + _h);80 error(_t("Widget <%s> has y + h > %d (%d)"), _name.c_str(), g_system->getOverlayHeight(), _y + _h); 80 81 } 81 82 } 82 83 … … 106 107 loadClassicTheme = false; 107 108 } else { 108 109 loadClassicTheme = true; 109 warning( "falling back to classic style");110 warning(_t("falling back to classic style")); 110 111 } 111 112 #endif 112 113 … … 114 115 _theme = new ThemeClassic(_system); 115 116 assert(_theme); 116 117 if (!_theme->init()) { 117 error( "Couldn't initialize classic theme");118 error(_t("Couldn't initialize classic theme")); 118 119 } 119 120 } 120 121 … … 151 152 _theme = new ThemeModern(_system, style, &cfg); 152 153 #endif 153 154 else 154 warning( "Unsupported theme type '%s'", styleType.c_str());155 warning(_t("Unsupported theme type '%s'"), styleType.c_str()); 155 156 } else { 156 warning( "Config '%s' is NOT usable for themes or not found", style.c_str());157 warning(_t("Config '%s' is NOT usable for themes or not found"), style.c_str()); 157 158 } 158 159 } 159 160 cfg.clear(); … … 162 163 return (!oldTheme.empty() ? loadNewTheme(oldTheme) : false); 163 164 164 165 if (!_theme->init()) { 165 warning( "Could not initialize your preferred theme");166 warning(_t("Could not initialize your preferred theme")); 166 167 delete _theme; 167 168 _theme = 0; 168 169 loadNewTheme(oldTheme); -
gui/KeysDialog.h
30 30 #include "gui/dialog.h" 31 31 #include "gui/ListWidget.h" 32 32 #include "common/str.h" 33 #include "common/translation.h" 33 34 34 35 namespace GUI { 35 36 36 37 class KeysDialog : public GUI::Dialog { 37 38 public: 38 KeysDialog(const Common::String &title = "Choose an action to map");39 KeysDialog(const Common::String &title = _("Choose an action to map")); 39 40 40 41 virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); 41 42 virtual void handleKeyUp(uint16 ascii, int keycode, int modifiers); -
gui/themebrowser.cpp
28 28 #include "gui/widget.h" 29 29 #include "gui/theme.h" 30 30 #include "common/fs.h" 31 #include "common/translation.h" 31 32 32 33 #ifdef MACOSX 33 34 #include "CoreFoundation/CoreFoundation.h" … … 48 49 ThemeBrowser::ThemeBrowser() : Dialog("browser") { 49 50 _fileList = 0; 50 51 51 new StaticTextWidget(this, "browser_headline", "Select a Theme");52 new StaticTextWidget(this, "browser_headline", _("Select a Theme")); 52 53 53 54 // Add file list 54 55 _fileList = new ListWidget(this, "browser_list"); … … 58 59 _fileList->setHints(THEME_HINT_PLAIN_COLOR); 59 60 60 61 // Buttons 61 new ButtonWidget(this, "browser_cancel", "Cancel", kCloseCmd, 0);62 new ButtonWidget(this, "browser_choose", "Choose", kChooseCmd, 0);62 new ButtonWidget(this, "browser_cancel", _("Cancel"), kCloseCmd, 0); 63 new ButtonWidget(this, "browser_choose", _("Choose"), kChooseCmd, 0); 63 64 } 64 65 65 66 void ThemeBrowser::open() { … … 93 94 94 95 // classic is always build in 95 96 Entry th; 96 th.name = "Classic (Builtin)";97 th.name = _("Classic (Builtin)"); 97 98 th.type = "Classic"; 98 99 th.file = "Classic (Builtin)"; 99 100 _themes.push_back(th); -
gui/ThemeModern.cpp
34 34 35 35 #include "common/config-manager.h" 36 36 #include "common/file.h" 37 #include "common/translation.h" 37 38 38 39 #define kShadowTr0 8 39 40 #define kShadowTr1 16 … … 76 77 _configFile = *cfg; 77 78 } else { 78 79 if (!loadConfigFile(stylefile)) { 79 warning( "Can not find theme config file '%s'", (stylefile + ".ini").c_str());80 warning(_t("Can not find theme config file '%s'"), (stylefile + ".ini").c_str()); 80 81 return; 81 82 } 82 83 } … … 87 88 _configFile.getKey("version", "theme", temp); 88 89 if (atoi(temp.c_str()) != THEME_VERSION) { 89 90 // TODO: improve this detection and handle it nicer 90 warning( "Theme config uses a different version (you have: '%s', needed is: '%d')", temp.c_str(), THEME_VERSION);91 warning(_t("Theme config uses a different version (you have: '%s', needed is: '%d')"), temp.c_str(), THEME_VERSION); 91 92 return; 92 93 } 93 94 94 95 temp.clear(); 95 96 _configFile.getKey("type", "theme", temp); 96 97 if (0 != temp.compareToIgnoreCase("modern")) { 97 warning( "Theme config is not for the modern style theme");98 warning(_t("Theme config is not for the modern style theme")); 98 99 return; 99 100 } 100 101 … … 1297 1298 1298 1299 _fonts[style] = loadFont(temp.c_str()); 1299 1300 if (!_fonts[style]) 1300 error( "Couldn't load %s font '%s'", key.c_str(), temp.c_str());1301 error(_t("Couldn't load %s font '%s'"), key.c_str(), temp.c_str()); 1301 1302 1302 1303 FontMan.assignFontToName(name, _fonts[style]); 1303 1304 } … … 1444 1445 break; 1445 1446 1446 1447 default: 1447 warning( "no valid 'inactive_dialog_shading' specified");1448 warning(_t("no valid 'inactive_dialog_shading' specified")); 1448 1449 } 1449 1450 1450 1451 setupFonts(); … … 1530 1531 _cursorPal[index * 4 + 3] = 0xFF; 1531 1532 1532 1533 if (colorsFound > MAX_CURS_COLORS) 1533 error( "Cursor contains too much colors (%d, but only %d are allowed)", colorsFound, MAX_CURS_COLORS);1534 error(_t("Cursor contains too much colors (%d, but only %d are allowed)"), colorsFound, MAX_CURS_COLORS); 1534 1535 } 1535 1536 1536 1537 if (col != transparency) { -
gui/massadd.cpp
33 33 #include "gui/newgui.h" 34 34 #include "gui/widget.h" 35 35 36 #include "common/translation.h" 36 37 38 37 39 namespace GUI { 38 40 39 41 /* … … 77 79 // - static text displaying the progress text 78 80 // - (future) a listbox showing all the games we added/are going to add 79 81 80 new StaticTextWidget(this, "massadddialog_caption", "Mass Add Dialog");82 new StaticTextWidget(this, "massadddialog_caption", _("Mass Add Dialog")); 81 83 82 84 _dirProgressText = new StaticTextWidget(this, "massadddialog_dirprogress", 83 "... progress ...");85 _("... progress ...")); 84 86 85 87 _gameProgressText = new StaticTextWidget(this, "massadddialog_gameprogress", 86 "... progress ...");88 _("... progress ...")); 87 89 88 90 _okButton = new ButtonWidget(this, "massadddialog_ok", "OK", kOkCmd, '\n'); 89 91 _okButton->setEnabled(false); … … 98 100 if (cmd == kOkCmd) { 99 101 // Add all the detected games to the config 100 102 for (GameList::const_iterator iter = _games.begin(); iter != _games.end(); ++iter) { 101 printf( " Added gameid '%s', desc '%s'\n",103 printf(_(" Added gameid '%s', desc '%s'\n"), 102 104 (*iter)["gameid"].c_str(), 103 105 (*iter)["description"].c_str()); 104 106 addGameToConf(*iter); … … 128 130 129 131 FSList files; 130 132 if (!dir.listDir(files, FilesystemNode::kListAll)) { 131 error( "browser returned a node that is not a directory: '%s'",133 error(_t("browser returned a node that is not a directory: '%s'"), 132 134 dir.path().c_str()); 133 135 } 134 136 … … 165 167 // Enable the OK button 166 168 _okButton->setEnabled(true); 167 169 168 snprintf(buf, sizeof(buf), "Scan complete!");170 snprintf(buf, sizeof(buf), _("Scan complete!")); 169 171 _dirProgressText->setLabel(buf); 170 172 171 snprintf(buf, sizeof(buf), "Discovered %d games.", _games.size());173 snprintf(buf, sizeof(buf), _("Discovered %d games."), _games.size()); 172 174 _gameProgressText->setLabel(buf); 173 175 174 176 } else { 175 snprintf(buf, sizeof(buf), "Scanned %d directories ...", _dirsScanned);177 snprintf(buf, sizeof(buf), _("Scanned %d directories ..."), _dirsScanned); 176 178 _dirProgressText->setLabel(buf); 177 179 178 snprintf(buf, sizeof(buf), "Discovered %d games ...", _games.size());180 snprintf(buf, sizeof(buf), _("Discovered %d games ..."), _games.size()); 179 181 _gameProgressText->setLabel(buf); 180 182 } 181 183 -
gui/eval.cpp
30 30 #include "gui/newgui.h" 31 31 32 32 #include "graphics/scaler.h" 33 #include "common/translation.h" 33 34 34 35 namespace GUI { 35 36 … … 71 72 72 73 level2(&result); 73 74 74 debug(5, "Result: %d", result);75 debug(5, _t("Result: %d"), result); 75 76 76 77 return result; 77 78 } … … 234 235 235 236 void Eval::exprError(EvalErrors err) { 236 237 static const char *errors[] = { 237 "Syntax error",238 "Extra ')'",239 "Missing ')'",240 "Bad expression",241 "Undefined variable",242 "Missing '\"'"238 _t("Syntax error"), 239 _t("Extra ')'"), 240 _t("Missing ')'"), 241 _t("Bad expression"), 242 _t("Undefined variable"), 243 _t("Missing '\"'") 243 244 }; 244 245 245 error( "%s in section [%s] expression: \"%s\" start is at: %d near token '%s'",246 error(_t("%s in section [%s] expression: \"%s\" start is at: %d near token '%s'"), 246 247 errors[err], _section.c_str(), _name.c_str(), _pos + _startpos, _token); 247 248 } 248 249 -
gui/message.h
27 27 28 28 #include "gui/dialog.h" 29 29 #include "common/str.h" 30 #include "common/translation.h" 30 31 31 32 namespace GUI { 32 33 … … 41 42 */ 42 43 class MessageDialog : public Dialog { 43 44 public: 44 MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0);45 MessageDialog(const Common::String &message, const char *defaultButton = _("OK"), const char *altButton = 0); 45 46 46 47 void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 47 48 }; -
gui/options.cpp
35 35 #include "common/fs.h" 36 36 #include "common/config-manager.h" 37 37 #include "common/system.h" 38 #include "common/translation.h" 38 39 39 40 #include "graphics/scaler.h" 40 41 … … 64 65 }; 65 66 #endif 66 67 67 static const char *savePeriodLabels[] = { "Never", "every 5 mins", "every 10 mins", "every 15 mins", "every 30 mins", 0 };68 static const char *savePeriodLabels[] = { _("Never"), _("every 5 mins"), _("every 10 mins"), _("every 15 mins"), _("every 30 mins"), 0 }; 68 69 static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 }; 69 static const char *outputRateLabels[] = { "Default", "22 kHz", "8 kHz", "11kHz", "44 kHz", "48 kHz", 0 };70 static const char *outputRateLabels[] = { _("Default"), _("22 kHz"), _("8 kHz"), _("11kHz"), _("44 kHz"), _("48 kHz"), 0 }; 70 71 static const int outputRateValues[] = { 0, 22050, 8000, 11025, 44100, 48000, -1 }; 71 72 72 73 … … 82 83 } 83 84 84 85 const char *OptionsDialog::_subModeDesc[] = { 85 "Speech Only",86 "Speech and Subtitles",87 "Subtitles Only"86 _("Speech Only"), 87 _("Speech and Subtitles"), 88 _("Subtitles Only") 88 89 }; 89 90 90 91 void OptionsDialog::init() { … … 201 202 202 203 String soundFont(ConfMan.get("soundfont", _domain)); 203 204 if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) { 204 _soundFont->setLabel( "None");205 _soundFont->setLabel(_("None")); 205 206 _soundFontClearButton->setEnabled(false); 206 207 } else { 207 208 _soundFont->setLabel(soundFont); … … 502 503 int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW"); 503 504 504 505 // The GFX mode popup 505 _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode: ", labelWidth);506 _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", _("Graphics mode: "), labelWidth); 506 507 507 _gfxPopUp->appendEntry( "<default>");508 _gfxPopUp->appendEntry(_("<default>")); 508 509 _gfxPopUp->appendEntry(""); 509 510 while (gm->name) { 510 511 _gfxPopUp->appendEntry(gm->description, gm->id); … … 512 513 } 513 514 514 515 // RenderMode popup 515 _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode: ", labelWidth);516 _renderModePopUp->appendEntry( "<default>", Common::kRenderDefault);516 _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", _("Render mode: "), labelWidth); 517 _renderModePopUp->appendEntry(_("<default>"), Common::kRenderDefault); 517 518 _renderModePopUp->appendEntry(""); 518 519 const Common::RenderModeDescription *rm = Common::g_renderModes; 519 520 for (; rm->code; ++rm) { … … 521 522 } 522 523 523 524 // Fullscreen checkbox 524 _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", "Fullscreen mode", 0, 0);525 _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode"), 0, 0); 525 526 526 527 // Aspect ratio checkbox 527 _aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", "Aspect ratio correction", 0, 0);528 _aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), 0, 0); 528 529 529 530 #ifdef SMALL_SCREEN_DEVICE 530 531 _fullscreenCheckbox->setState(true); … … 539 540 int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW"); 540 541 541 542 // The MIDI mode popup & a label 542 _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver: ", labelWidth);543 _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", _("Music driver: "), labelWidth); 543 544 544 545 // Populate it 545 546 const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers(); … … 549 550 } 550 551 551 552 // Sample rate settings 552 _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate: ", labelWidth);553 _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", _("Output rate: "), labelWidth); 553 554 554 555 for (int i = 0; outputRateLabels[i]; i++) { 555 556 _outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]); … … 560 561 561 562 void OptionsDialog::addMIDIControls(GuiObject *boss, const String &prefix) { 562 563 // SoundFont 563 _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", "SoundFont:", kChooseSoundFontCmd, 0);564 _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", "None");565 _soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", kClearSoundFontCmd, 0);564 _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), kChooseSoundFontCmd, 0); 565 _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None")); 566 _soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", _("C"), kClearSoundFontCmd, 0); 566 567 567 568 // Multi midi setting 568 _multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", "Mixed Adlib/MIDI mode", 0, 0);569 _multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", _("Mixed Adlib/MIDI mode"), 0, 0); 569 570 570 571 // Native mt32 setting 571 _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", "True Roland MT-32 (disable GM emulation)", 0, 0);572 _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), 0, 0); 572 573 573 574 // GS Extensions setting 574 _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", "Enable Roland GS Mode", 0, 0);575 _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), 0, 0); 575 576 576 577 // MIDI gain setting (FluidSynth uses this) 577 _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", "MIDI gain:");578 _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:")); 578 579 _midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", kMidiGainChanged); 579 580 _midiGainSlider->setMinValue(0); 580 581 _midiGainSlider->setMaxValue(1000); … … 587 588 // make use of the widgets. The launcher range is 0-255. SCUMM's 0-9 588 589 void OptionsDialog::addSubtitleControls(GuiObject *boss, const String &prefix, int maxSliderVal) { 589 590 590 _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", "Text and Speech:");591 _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:")); 591 592 _subToggleButton = new ButtonWidget(boss, prefix + "subToggleButton", "", kSubtitleToggle, 0); 592 593 593 594 // Subtitle speed 594 _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", "Subtitle speed:");595 _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:")); 595 596 _subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", kSubtitleSpeedChanged); 596 597 _subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%"); 597 598 _subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal); … … 603 604 void OptionsDialog::addVolumeControls(GuiObject *boss, const String &prefix) { 604 605 605 606 // Volume controllers 606 _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", "Music volume:");607 _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:")); 607 608 _musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", kMusicVolumeChanged); 608 609 _musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%"); 609 610 _musicVolumeSlider->setMinValue(0); 610 611 _musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume); 611 612 _musicVolumeLabel->setFlags(WIDGET_CLEARBG); 612 613 613 _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");614 _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:")); 614 615 _sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged); 615 616 _sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%"); 616 617 _sfxVolumeSlider->setMinValue(0); 617 618 _sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume); 618 619 _sfxVolumeLabel->setFlags(WIDGET_CLEARBG); 619 620 620 _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , "Speech volume:");621 _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:")); 621 622 _speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", kSpeechVolumeChanged); 622 623 _speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%"); 623 624 _speechVolumeSlider->setMinValue(0); … … 635 636 else if (subtitles && speech_mute) // Subtitles only 636 637 return 2; 637 638 else 638 warning( "Wrong configuration: Both subtitles and speech are off. Assuming subtitles only");639 warning(_t("Wrong configuration: Both subtitles and speech are off. Assuming subtitles only")); 639 640 return 2; 640 641 } 641 642 … … 667 668 // 668 669 // 1) The graphics tab 669 670 // 670 tab->addTab( "Graphics");671 tab->addTab(_("Graphics")); 671 672 addGraphicControls(tab, "globaloptions_"); 672 673 673 674 // 674 675 // 2) The audio tab 675 676 // 676 tab->addTab( "Audio");677 tab->addTab(_("Audio")); 677 678 addAudioControls(tab, "globaloptions_"); 678 679 addSubtitleControls(tab, "globaloptions_"); 679 680 680 tab->addTab( "Volume");681 tab->addTab(_("Volume")); 681 682 addVolumeControls(tab, "globaloptions_"); 682 683 683 684 // TODO: cd drive setting … … 685 686 // 686 687 // 3) The MIDI tab 687 688 // 688 tab->addTab( "MIDI");689 tab->addTab(_("MIDI")); 689 690 addMIDIControls(tab, "globaloptions_"); 690 691 691 692 // 692 693 // 4) The miscellaneous tab 693 694 // 694 tab->addTab( "Paths");695 tab->addTab(_("Paths")); 695 696 696 697 #if !( defined(__DC__) || defined(__GP32__) ) 697 698 // These two buttons have to be extra wide, or the text will be 698 699 // truncated in the small version of the GUI. 699 700 700 701 // Save game path 701 new ButtonWidget(tab, "globaloptions_savebutton", "Save Path: ", kChooseSaveDirCmd, 0);702 new ButtonWidget(tab, "globaloptions_savebutton", _("Save Path: "), kChooseSaveDirCmd, 0); 702 703 _savePath = new StaticTextWidget(tab, "globaloptions_savepath", "/foo/bar"); 703 704 704 new ButtonWidget(tab, "globaloptions_themebutton", "Theme Path:", kChooseThemeDirCmd, 0);705 new ButtonWidget(tab, "globaloptions_themebutton", _("Theme Path:"), kChooseThemeDirCmd, 0); 705 706 _themePath = new StaticTextWidget(tab, "globaloptions_themepath", "None"); 706 707 707 new ButtonWidget(tab, "globaloptions_extrabutton", "Extra Path:", kChooseExtraDirCmd, 0);708 new ButtonWidget(tab, "globaloptions_extrabutton", _("Extra Path:"), kChooseExtraDirCmd, 0); 708 709 _extraPath = new StaticTextWidget(tab, "globaloptions_extrapath", "None"); 709 710 #endif 710 711 711 712 #ifdef SMALL_SCREEN_DEVICE 712 new ButtonWidget(tab, "globaloptions_keysbutton", "Keys", kChooseKeyMappingCmd, 0);713 new ButtonWidget(tab, "globaloptions_keysbutton", _("Keys"), kChooseKeyMappingCmd, 0); 713 714 #endif 714 715 715 tab->addTab( "Misc");716 tab->addTab(_("Misc")); 716 717 717 new ButtonWidget(tab, "globaloptions_themebutton2", "Theme:", kChooseThemeCmd, 0);718 new ButtonWidget(tab, "globaloptions_themebutton2", _("Theme:"), kChooseThemeCmd, 0); 718 719 _curTheme = new StaticTextWidget(tab, "globaloptions_curtheme", g_gui.theme()->getThemeName()); 719 720 720 721 int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW"); 721 722 722 _autosavePeriodPopUp = new PopUpWidget(tab, "globaloptions_autosaveperiod", "Autosave: ", labelWidth);723 _autosavePeriodPopUp = new PopUpWidget(tab, "globaloptions_autosaveperiod", _("Autosave: "), labelWidth); 723 724 724 725 for (int i = 0; savePeriodLabels[i]; i++) { 725 726 _autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]); … … 732 733 tab->setActiveTab(0); 733 734 734 735 // Add OK & Cancel buttons 735 new ButtonWidget(this, "globaloptions_cancel", "Cancel", kCloseCmd, 0);736 new ButtonWidget(this, "globaloptions_ok", "OK", kOKCmd, 0);736 new ButtonWidget(this, "globaloptions_cancel", _("Cancel"), kCloseCmd, 0); 737 new ButtonWidget(this, "globaloptions_ok", _("OK"), kOKCmd, 0); 737 738 738 739 #ifdef SMALL_SCREEN_DEVICE 739 740 _keysDialog = new KeysDialog(); … … 756 757 Common::String extraPath(ConfMan.get("extrapath", _domain)); 757 758 758 759 if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { 759 _savePath->setLabel( "None");760 _savePath->setLabel(_("None")); 760 761 } else { 761 762 _savePath->setLabel(savePath); 762 763 } 763 764 764 765 if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) { 765 _themePath->setLabel( "None");766 _themePath->setLabel(_("None")); 766 767 } else { 767 768 _themePath->setLabel(themePath); 768 769 } 769 770 770 771 if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { 771 _extraPath->setLabel( "None");772 _extraPath->setLabel(_("None")); 772 773 } else { 773 774 _extraPath->setLabel(extraPath); 774 775 } … … 786 787 void GlobalOptionsDialog::close() { 787 788 if (getResult()) { 788 789 String savePath(_savePath->getLabel()); 789 if (!savePath.empty() && (savePath != "None"))790 if (!savePath.empty() && (savePath != _("None"))) 790 791 ConfMan.set("savepath", savePath, _domain); 791 792 792 793 String themePath(_themePath->getLabel()); 793 if (!themePath.empty() && (themePath != "None"))794 if (!themePath.empty() && (themePath != _("None"))) 794 795 ConfMan.set("themepath", themePath, _domain); 795 796 else 796 797 ConfMan.removeKey("themepath", _domain); 797 798 798 799 String extraPath(_extraPath->getLabel()); 799 if (!extraPath.empty() && (extraPath != "None"))800 if (!extraPath.empty() && (extraPath != _("None"))) 800 801 ConfMan.set("extrapath", extraPath, _domain); 801 802 else 802 803 ConfMan.removeKey("extrapath", _domain); … … 809 810 void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { 810 811 switch (cmd) { 811 812 case kChooseSaveDirCmd: { 812 BrowserDialog browser( "Select directory for savegames", true);813 BrowserDialog browser(_("Select directory for savegames"), true); 813 814 if (browser.runModal() > 0) { 814 815 // User made his choice... 815 816 FilesystemNode dir(browser.getResult()); … … 820 821 break; 821 822 } 822 823 case kChooseThemeDirCmd: { 823 BrowserDialog browser( "Select directory for GUI themes", true);824 BrowserDialog browser(_("Select directory for GUI themes"), true); 824 825 if (browser.runModal() > 0) { 825 826 // User made his choice... 826 827 FilesystemNode dir(browser.getResult()); … … 830 831 break; 831 832 } 832 833 case kChooseExtraDirCmd: { 833 BrowserDialog browser( "Select directory for extra files", true);834 BrowserDialog browser(_("Select directory for extra files"), true); 834 835 if (browser.runModal() > 0) { 835 836 // User made his choice... 836 837 FilesystemNode dir(browser.getResult()); … … 840 841 break; 841 842 } 842 843 case kChooseSoundFontCmd: { 843 BrowserDialog browser( "Select SoundFont", false);844 BrowserDialog browser(_("Select SoundFont"), false); 844 845 if (browser.runModal() > 0) { 845 846 // User made his choice... 846 847 FilesystemNode file(browser.getResult()); 847 848 _soundFont->setLabel(file.path()); 848 849 849 if (!file.path().empty() && (file.path() != "None"))850 if (!file.path().empty() && (file.path() != _("None"))) 850 851 _soundFontClearButton->setEnabled(true); 851 852 else 852 853 _soundFontClearButton->setEnabled(false); … … 856 857 break; 857 858 } 858 859 case kClearSoundFontCmd: { 859 _soundFont->setLabel( "None");860 _soundFont->setLabel(_("None")); 860 861 _soundFontClearButton->setEnabled(false); 861 862 draw(); 862 863 break; -
gui/KeysDialog.cpp
42 42 KeysDialog::KeysDialog(const Common::String &title) 43 43 : GUI::Dialog("keysdialog") { 44 44 45 new ButtonWidget(this, "keysdialog_map", "Map", kMapCmd, 0);46 new ButtonWidget(this, "keysdialog_ok", "OK", kOKCmd, 0);47 new ButtonWidget(this, "keysdialog_cancel", "Cancel", kCloseCmd, 0);45 new ButtonWidget(this, "keysdialog_map", _("Map"), kMapCmd, 0); 46 new ButtonWidget(this, "keysdialog_ok", _("OK"), kOKCmd, 0); 47 new ButtonWidget(this, "keysdialog_cancel", _("Cancel"), kCloseCmd, 0); 48 48 49 49 _actionsList = new ListWidget(this, "keysdialog_list"); 50 50 _actionsList->setNumberingMode(kListNumberingZero); 51 51 52 52 _actionTitle = new StaticTextWidget(this, "keysdialog_action", title); 53 _keyMapping = new StaticTextWidget(this, "keysdialog_mapping", "Select an action and click 'Map'");53 _keyMapping = new StaticTextWidget(this, "keysdialog_mapping", _("Select an action and click 'Map'")); 54 54 55 55 _actionTitle->setFlags(WIDGET_CLEARBG); 56 56 _keyMapping->setFlags(WIDGET_CLEARBG); … … 81 81 key = key - 315 + SDLK_F1; 82 82 #endif 83 83 if (key != 0) 84 sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));84 sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); 85 85 else 86 sprintf(selection, "Associated key : none");86 sprintf(selection, _("Associated key : none")); 87 87 88 88 _keyMapping->setLabel(selection); 89 89 _keyMapping->draw(); … … 104 104 key = key - 315 + SDLK_F1; 105 105 #endif 106 106 if (key != 0) 107 sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));107 sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); 108 108 else 109 sprintf(selection, "Associated key : none");109 sprintf(selection, _("Associated key : none")); 110 110 111 _actionTitle->setLabel( "Press the key to associate");111 _actionTitle->setLabel(_("Press the key to associate")); 112 112 _keyMapping->setLabel(selection); 113 113 _keyMapping->draw(); 114 114 Actions::Instance()->beginMapping(true); … … 143 143 Actions::Instance()->setMapping((ActionType)_actionSelected, ascii); 144 144 145 145 if (ascii != 0) 146 sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey) keycode));146 sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey) keycode)); 147 147 else 148 sprintf(selection, "Associated key : none");148 sprintf(selection, _("Associated key : none")); 149 149 150 _actionTitle->setLabel( "Choose an action to map");150 _actionTitle->setLabel(_("Choose an action to map")); 151 151 _keyMapping->setLabel(selection); 152 152 _keyMapping->draw(); 153 153 _actionTitle->draw(); -
gui/dialog.cpp
30 30 #include "gui/PopUpWidget.h" 31 31 32 32 #include "common/system.h" 33 #include "common/translation.h" 33 34 34 35 namespace GUI { 35 36 … … 63 64 // Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game" 64 65 // and bug #1595627: "SCUMM: F5 crashes game (640x480)" 65 66 if (g_gui.theme()->needThemeReload()) { 66 debug(2, "Theme forced to reload");67 debug(2, _t("Theme forced to reload")); 67 68 g_gui.screenChange(); 68 69 } 69 70 } -
gui/launcher.cpp
34 34 #include "common/fs.h" 35 35 #include "common/util.h" 36 36 #include "common/system.h" 37 #include "common/translation.h" 37 38 38 39 #include "gui/about.h" 39 40 #include "gui/browser.h" … … 168 169 // 169 170 // 1) The game tab 170 171 // 171 tab->addTab( "Game");172 tab->addTab(_("Game")); 172 173 173 174 // GUI: Label & edit widget for the game ID 174 new StaticTextWidget(tab, "gameoptions_id", "ID: ");175 new StaticTextWidget(tab, "gameoptions_id", _("ID: ")); 175 176 _domainWidget = new DomainEditTextWidget(tab, "gameoptions_domain", _domain); 176 177 177 178 // GUI: Label & edit widget for the description 178 new StaticTextWidget(tab, "gameoptions_name", "Name: ");179 new StaticTextWidget(tab, "gameoptions_name", _("Name: ")); 179 180 _descriptionWidget = new EditTextWidget(tab, "gameoptions_desc", description); 180 181 181 182 // Language popup 182 _langPopUp = new PopUpWidget(tab, "gameoptions_lang", "Language: ", labelWidth);183 _langPopUp->appendEntry( "<default>");183 _langPopUp = new PopUpWidget(tab, "gameoptions_lang", _("Language: "), labelWidth); 184 _langPopUp->appendEntry(_("<default>")); 184 185 _langPopUp->appendEntry(""); 185 186 const Common::LanguageDescription *l = Common::g_languages; 186 187 for (; l->code; ++l) { … … 188 189 } 189 190 190 191 // Platform popup 191 _platformPopUp = new PopUpWidget(tab, "gameoptions_platform", "Platform: ", labelWidth);192 _platformPopUp->appendEntry( "<default>");192 _platformPopUp = new PopUpWidget(tab, "gameoptions_platform", _("Platform: "), labelWidth); 193 _platformPopUp->appendEntry(_("<default>")); 193 194 _platformPopUp->appendEntry(""); 194 195 const Common::PlatformDescription *p = Common::g_platforms; 195 196 for (; p->code; ++p) { … … 199 200 // 200 201 // 3) The graphics tab 201 202 // 202 tab->addTab( "Graphics");203 tab->addTab(_("Graphics")); 203 204 204 _globalGraphicsOverride = new CheckboxWidget(tab, "gameoptions_graphicsCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0);205 _globalGraphicsOverride = new CheckboxWidget(tab, "gameoptions_graphicsCheckbox", _("Override global graphic settings"), kCmdGlobalGraphicsOverride, 0); 205 206 206 207 addGraphicControls(tab, "gameoptions_"); 207 208 208 209 // 209 210 // 4) The audio tab 210 211 // 211 tab->addTab( "Audio");212 tab->addTab(_("Audio")); 212 213 213 _globalAudioOverride = new CheckboxWidget(tab, "gameoptions_audioCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0);214 _globalAudioOverride = new CheckboxWidget(tab, "gameoptions_audioCheckbox", _("Override global audio settings"), kCmdGlobalAudioOverride, 0); 214 215 215 216 addAudioControls(tab, "gameoptions_"); 216 217 addSubtitleControls(tab, "gameoptions_"); … … 218 219 // 219 220 // 5) The volume tab 220 221 // 221 tab->addTab( "Volume");222 tab->addTab(_("Volume")); 222 223 223 _globalVolumeOverride = new CheckboxWidget(tab, "gameoptions_volumeCheckbox", "Override global volume settings", kCmdGlobalVolumeOverride, 0);224 _globalVolumeOverride = new CheckboxWidget(tab, "gameoptions_volumeCheckbox", _("Override global volume settings"), kCmdGlobalVolumeOverride, 0); 224 225 225 226 addVolumeControls(tab, "gameoptions_"); 226 227 227 228 // 228 229 // 6) The MIDI tab 229 230 // 230 tab->addTab( "MIDI");231 tab->addTab(_("MIDI")); 231 232 232 _globalMIDIOverride = new CheckboxWidget(tab, "gameoptions_midiCheckbox", "Override global MIDI settings", kCmdGlobalMIDIOverride, 0);233 _globalMIDIOverride = new CheckboxWidget(tab, "gameoptions_midiCheckbox", _("Override global MIDI settings"), kCmdGlobalMIDIOverride, 0); 233 234 234 235 addMIDIControls(tab, "gameoptions_"); 235 236 236 237 // 237 238 // 2) The 'Path' tab 238 239 // 239 tab->addTab( "Paths");240 tab->addTab(_("Paths")); 240 241 241 242 // These buttons have to be extra wide, or the text will be truncated 242 243 // in the small version of the GUI. 243 244 244 245 // GUI: Button + Label for the game path 245 new ButtonWidget(tab, "gameoptions_gamepath", "Game Path: ", kCmdGameBrowser, 0);246 new ButtonWidget(tab, "gameoptions_gamepath", _("Game Path: "), kCmdGameBrowser, 0); 246 247 _gamePathWidget = new StaticTextWidget(tab, "gameoptions_gamepathText", gamePath); 247 248 248 249 // GUI: Button + Label for the additional path 249 new ButtonWidget(tab, "gameoptions_extrapath", "Extra Path:", kCmdExtraBrowser, 0);250 new ButtonWidget(tab, "gameoptions_extrapath", _("Extra Path:"), kCmdExtraBrowser, 0); 250 251 _extraPathWidget = new StaticTextWidget(tab, "gameoptions_extrapathText", extraPath); 251 252 if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { 252 _extraPathWidget->setLabel( "None");253 _extraPathWidget->setLabel(_("None")); 253 254 } 254 255 255 256 // GUI: Button + Label for the save path 256 new ButtonWidget(tab, "gameoptions_savepath", "Save Path: ", kCmdSaveBrowser, 0);257 new ButtonWidget(tab, "gameoptions_savepath", _("Save Path: "), kCmdSaveBrowser, 0); 257 258 _savePathWidget = new StaticTextWidget(tab, "gameoptions_savepathText", savePath); 258 259 if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { 259 _savePathWidget->setLabel( "Default");260 _savePathWidget->setLabel(_("Default")); 260 261 } 261 262 262 263 // Activate the first tab 263 264 tab->setActiveTab(0); 264 265 265 266 // Add OK & Cancel buttons 266 new ButtonWidget(this, "gameoptions_cancel", "Cancel", kCloseCmd, 0);267 new ButtonWidget(this, "gameoptions_ok", "OK", kOKCmd, 0);267 new ButtonWidget(this, "gameoptions_cancel", _("Cancel"), kCloseCmd, 0); 268 new ButtonWidget(this, "gameoptions_ok", _("OK"), kOKCmd, 0); 268 269 } 269 270 270 271 void EditGameDialog::reflowLayout() { … … 351 352 ConfMan.set("path", gamePath, _domain); 352 353 353 354 String extraPath(_extraPathWidget->getLabel()); 354 if (!extraPath.empty() && (extraPath != "None"))355 if (!extraPath.empty() && (extraPath != _("None"))) 355 356 ConfMan.set("extrapath", extraPath, _domain); 356 357 357 358 String savePath(_savePathWidget->getLabel()); 358 if (!savePath.empty() && (savePath != "Default"))359 if (!savePath.empty() && (savePath != _("Default"))) 359 360 ConfMan.set("savepath", savePath, _domain); 360 361 361 362 Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag(); … … 389 390 draw(); 390 391 break; 391 392 case kCmdChooseSoundFontCmd: { 392 BrowserDialog browser( "Select SoundFont", false);393 BrowserDialog browser(_("Select SoundFont"), false); 393 394 394 395 if (browser.runModal() > 0) { 395 396 // User made this choice... 396 397 FilesystemNode file(browser.getResult()); 397 398 _soundFont->setLabel(file.path()); 398 399 399 if (!file.path().empty() && (file.path() != "None"))400 if (!file.path().empty() && (file.path() != _("None"))) 400 401 _soundFontClearButton->setEnabled(true); 401 402 else 402 403 _soundFontClearButton->setEnabled(false); … … 408 409 409 410 // Change path for the game 410 411 case kCmdGameBrowser: { 411 BrowserDialog browser( "Select directory with game data", true);412 BrowserDialog browser(_("Select directory with game data"), true); 412 413 if (browser.runModal() > 0) { 413 414 // User made his choice... 414 415 FilesystemNode dir(browser.getResult()); … … 426 427 427 428 // Change path for extra game data (eg, using sword cutscenes when playing via CD) 428 429 case kCmdExtraBrowser: { 429 BrowserDialog browser( "Select additional game directory", true);430 BrowserDialog browser(_("Select additional game directory"), true); 430 431 if (browser.runModal() > 0) { 431 432 // User made his choice... 432 433 FilesystemNode dir(browser.getResult()); … … 438 439 } 439 440 // Change path for stored save game (perm and temp) data 440 441 case kCmdSaveBrowser: { 441 BrowserDialog browser( "Select directory for saved games", true);442 BrowserDialog browser(_("Select directory for saved games"), true); 442 443 if (browser.runModal() > 0) { 443 444 // User made his choice... 444 445 FilesystemNode dir(browser.getResult()); … … 454 455 String newDomain(_domainWidget->getEditString()); 455 456 if (newDomain != _domain) { 456 457 if (newDomain.empty() || ConfMan.hasGameDomain(newDomain)) { 457 MessageDialog alert( "This game ID is already taken. Please choose another one.");458 MessageDialog alert(_("This game ID is already taken. Please choose another one.")); 458 459 alert.runModal(); 459 460 return; 460 461 } … … 496 497 new StaticTextWidget(this, "launcher_version", gScummVMFullVersion); 497 498 #endif 498 499 499 new ButtonWidget(this, "launcher_quit_button", "Quit", kQuitCmd, 'Q');500 new ButtonWidget(this, "launcher_about_button", "About", kAboutCmd, 'B');501 new ButtonWidget(this, "launcher_options_button", "Options", kOptionsCmd, 'O');500 new ButtonWidget(this, "launcher_quit_button", _("Quit"), kQuitCmd, 'Q'); 501 new ButtonWidget(this, "launcher_about_button", _("About"), kAboutCmd, 'B'); 502 new ButtonWidget(this, "launcher_options_button", _("Options"), kOptionsCmd, 'O'); 502 503 _startButton = 503 new ButtonWidget(this, "launcher_start_button", "Start", kStartCmd, 'S');504 new ButtonWidget(this, "launcher_start_button", _("Start"), kStartCmd, 'S'); 504 505 505 506 // Above the lowest button rows: two more buttons (directly below the list box) 506 507 _addButton = 507 new ButtonWidget(this, "launcher_addGame_button", "Add Game...", kAddGameCmd, 'A');508 new ButtonWidget(this, "launcher_addGame_button", _("Add Game..."), kAddGameCmd, 'A'); 508 509 _editButton = 509 new ButtonWidget(this, "launcher_editGame_button", "Edit Game...", kEditGameCmd, 'E');510 new ButtonWidget(this, "launcher_editGame_button", _("Edit Game..."), kEditGameCmd, 'E'); 510 511 _removeButton = 511 new ButtonWidget(this, "launcher_removeGame_button", "Remove Game", kRemoveGameCmd, 'R');512 new ButtonWidget(this, "launcher_removeGame_button", _("Remove Game"), kRemoveGameCmd, 'R'); 512 513 513 514 514 515 // Add list with game titles … … 528 529 updateButtons(); 529 530 530 531 // Create file browser dialog 531 _browser = new BrowserDialog( "Select directory with game data", true);532 _browser = new BrowserDialog(_("Select directory with game data"), true); 532 533 } 533 534 534 535 void LauncherDialog::selectGame(const String &name) { … … 617 618 bool massAdd = (modifiers & Common::KBD_SHIFT) != 0; 618 619 619 620 if (massAdd) { 620 MessageDialog alert( "Do you really want to run the mass game detector? "621 "This could potentially add a huge number of games." , "Yes", "No");621 MessageDialog alert(_("Do you really want to run the mass game detector? " 622 "This could potentially add a huge number of games."), _("Yes"), _("No")); 622 623 if (alert.runModal() == GUI::kMessageOK && _browser->runModal() > 0) { 623 624 MassAddDialog massAddDlg(_browser->getResult()); 624 625 massAddDlg.runModal(); … … 646 647 FilesystemNode dir(_browser->getResult()); 647 648 FSList files; 648 649 if (!dir.listDir(files, FilesystemNode::kListAll)) { 649 error( "browser returned a node that is not a directory: '%s'",650 error(_t("browser returned a node that is not a directory: '%s'"), 650 651 dir.path().c_str()); 651 652 } 652 653 … … 657 658 int idx; 658 659 if (candidates.empty()) { 659 660 // No game was found in the specified directory 660 MessageDialog alert( "ScummVM could not find any game in the specified directory!");661 MessageDialog alert(_("ScummVM could not find any game in the specified directory!")); 661 662 alert.runModal(); 662 663 idx = -1; 663 664 } else if (candidates.size() == 1) { … … 669 670 for (idx = 0; idx < (int)candidates.size(); idx++) 670 671 list.push_back(candidates[idx].description()); 671 672 672 ChooserDialog dialog( "Pick the game:");673 ChooserDialog dialog(_("Pick the game:")); 673 674 dialog.setList(list); 674 675 idx = dialog.runModal(); 675 676 } … … 749 750 } 750 751 751 752 void LauncherDialog::removeGame(int item) { 752 MessageDialog alert( "Do you really want to remove this game configuration?", "Yes", "No");753 MessageDialog alert(_("Do you really want to remove this game configuration?"), _("Yes"), _("No")); 753 754 754 755 if (alert.runModal() == GUI::kMessageOK) { 755 756 // Remove the currently selected game from the list … … 861 862 // Update the label of the "Add" button depending on whether shift is pressed or not 862 863 int modifiers = g_system->getEventManager()->getModifierState(); 863 864 const char *newAddButtonLabel = ((modifiers & Common::KBD_SHIFT) != 0) 864 ? "Mass Add..."865 : "Add Game...";865 ? _("Mass Add...") 866 : _("Add Game..."); 866 867 867 868 if (_addButton->getLabel() != newAddButtonLabel) { 868 869 _addButton->setLabel(newAddButtonLabel); -
gui/chooser.cpp
27 27 #include "gui/chooser.h" 28 28 #include "gui/newgui.h" 29 29 #include "gui/ListWidget.h" 30 #include "common/translation.h" 30 31 31 32 namespace GUI { 32 33 … … 47 48 _list->setNumberingMode(kListNumberingOff); 48 49 49 50 // Buttons 50 new ButtonWidget(this, prefix + "chooser_cancel", "Cancel", kCloseCmd, 0);51 new ButtonWidget(this, prefix + "chooser_cancel", _("Cancel"), kCloseCmd, 0); 51 52 _chooseButton = new ButtonWidget(this, prefix + "chooser_ok", buttonLabel, kChooseCmd, 0); 52 53 _chooseButton->setEnabled(false); 53 54 } -
gui/theme.cpp
26 26 #include "gui/eval.h" 27 27 28 28 #include "common/unzip.h" 29 #include "common/translation.h" 29 30 30 31 namespace GUI { 31 32 … … 122 123 if (font) { 123 124 if (!cacheFilename.empty()) { 124 125 if (!Graphics::NewFont::cacheFontData(*font, cacheFilename)) { 125 warning( "Couldn't create cache file for font '%s'", filename);126 warning(_t("Couldn't create cache file for font '%s'"), filename); 126 127 } 127 128 } 128 129 } -
gui/ThemeClassic.cpp
24 24 25 25 #include "gui/ThemeClassic.h" 26 26 #include "gui/eval.h" 27 #include "common/translation.h" 27 28 28 29 namespace GUI { 29 30 ThemeClassic::ThemeClassic(OSystem *system, const Common::String &config, const Common::ConfigFile *cfg) : Theme() { … … 663 664 _configFile.getKey("version", "theme", temp); 664 665 if (atoi(temp.c_str()) != THEME_VERSION) { 665 666 // TODO: improve this detection and handle it nicer 666 warning( "Theme config uses a different version (you have: '%s', needed is: '%d')", temp.c_str(), THEME_VERSION);667 warning(_t("Theme config uses a different version (you have: '%s', needed is: '%d')"), temp.c_str(), THEME_VERSION); 667 668 _configFile.clear(); 668 669 669 670 // force a theme reload here … … 674 675 temp.clear(); 675 676 _configFile.getKey("type", "theme", temp); 676 677 if (0 != temp.compareToIgnoreCase("classic")) { 677 warning( "Theme config is not for the classic style theme");678 warning(_t("Theme config is not for the classic style theme")); 678 679 _configFile.clear(); 679 680 680 681 // force a theme reload here -
gui/theme-config.cpp
24 24 25 25 #include "gui/theme.h" 26 26 #include "gui/eval.h" 27 #include "common/translation.h" 27 28 28 29 namespace GUI { 29 30 … … 536 537 level++; 537 538 else if (str[i] == ')') { 538 539 if (level == 0) { 539 error( "Extra ')' in section: [%s] expression: \"%s\" start is at: %d",540 error(_t("Extra ')' in section: [%s] expression: \"%s\" start is at: %d"), 540 541 section.c_str(), name.c_str(), start); 541 542 } 542 543 level--; … … 544 545 } 545 546 546 547 if (level > 0) 547 error( "Missing ')' in section: [%s] expression: \"%s\" start is at: %d",548 error(_t("Missing ')' in section: [%s] expression: \"%s\" start is at: %d"), 548 549 section.c_str(), name.c_str(), start); 549 550 550 551 const char **postfixes = (ntmppostfix == 2) ? postfixesRGB : postfixesXYWH; … … 610 611 } 611 612 if (iterk->key == "use") { 612 613 if (iterk->value == name) 613 error( "Theme section [%s]: cannot use itself", name.c_str());614 error(_t("Theme section [%s]: cannot use itself"), name.c_str()); 614 615 if (!config.hasSection(name)) 615 error( "Undefined use of section [%s]", name.c_str());616 error(_t("Undefined use of section [%s]"), name.c_str()); 616 617 processResSection(config, iterk->value, true); 617 618 continue; 618 619 } 619 620 if (iterk->key == "useAsIs") { 620 621 if (iterk->value == name) 621 error( "Theme section [%s]: cannot use itself", name.c_str());622 error(_t("Theme section [%s]: cannot use itself"), name.c_str()); 622 623 if (!config.hasSection(name)) 623 error( "Undefined use of section [%s]", name.c_str());624 error(_t("Undefined use of section [%s]"), name.c_str()); 624 625 processResSection(config, iterk->value); 625 626 continue; 626 627 } … … 629 630 const char *pos = strrchr(temp, ' '); 630 631 631 632 if (pos == NULL) 632 error( "2 arguments required for useWithPrefix keyword");633 error(_t("2 arguments required for useWithPrefix keyword")); 633 634 634 635 String n(temp, strchr(temp, ' ') - temp); 635 636 String pref(pos + 1); 636 637 637 638 if (n == name) 638 error( "Theme section [%s]: cannot use itself", n.c_str());639 error(_t("Theme section [%s]: cannot use itself"), n.c_str()); 639 640 if (!config.hasSection(n)) 640 error( "Undefined use of section [%s]", n.c_str());641 error(_t("Undefined use of section [%s]"), n.c_str()); 641 642 processResSection(config, n, true, pref); 642 643 continue; 643 644 } … … 693 694 } else if (*ptr == 'x') { 694 695 phase = 1; 695 696 } else { 696 error( "Syntax error. Wrong resolution in skipFor in section %s", name);697 error(_t("Syntax error. Wrong resolution in skipFor in section %s"), name); 697 698 } 698 699 break; 699 700 case 1: … … 710 711 phase = x = y = 0; 711 712 } 712 713 } else { 713 error( "Syntax error. Wrong resolution in skipFor in section %s", name);714 error(_t("Syntax error. Wrong resolution in skipFor in section %s"), name); 714 715 } 715 716 break; 716 717 case 2: … … 721 722 return true; 722 723 return false; 723 724 } else { 724 error ( "Syntax error. Wrong resolution in skipFor in section %s", name);725 error (_t("Syntax error. Wrong resolution in skipFor in section %s"), name); 725 726 } 726 727 break; 727 728 default: … … 757 758 if (config.hasSection(name) && !sectionIsSkipped(config, name, x, y)) 758 759 processResSection(config, name); 759 760 760 debug(3, "Number of variables: %d", _evaluator->getNumVars());761 debug(3, _t("Number of variables: %d"), _evaluator->getNumVars()); 761 762 } 762 763 763 764 } // End of namespace GUI -
gui/browser.cpp
31 31 #include "common/fs.h" 32 32 #include "common/system.h" 33 33 #include "common/algorithm.h" 34 #include "common/translation.h" 34 35 35 36 namespace GUI { 36 37 … … 155 156 _fileList->setHints(THEME_HINT_PLAIN_COLOR); 156 157 157 158 // Buttons 158 new ButtonWidget(this, "browser_up", "Go up", kGoUpCmd, 0);159 new ButtonWidget(this, "browser_cancel", "Cancel", kCloseCmd, 0);160 new ButtonWidget(this, "browser_choose", "Choose", kChooseCmd, 0);159 new ButtonWidget(this, "browser_up", _("Go up"), kGoUpCmd, 0); 160 new ButtonWidget(this, "browser_cancel", _("Cancel"), kCloseCmd, 0); 161 new ButtonWidget(this, "browser_choose", _("Choose"), kChooseCmd, 0); 161 162 } 162 163 163 164 void BrowserDialog::open() { -
gui/debugger.cpp
26 26 #include "common/stdafx.h" 27 27 28 28 #include "common/system.h" 29 #include "common/translation.h" 29 30 30 31 #include "gui/debugger.h" 31 32 #if USE_CONSOLE … … 123 124 void Debugger::enter() { 124 125 #if USE_CONSOLE 125 126 if (_firstTime) { 126 DebugPrintf( "Debugger started, type 'exit' to return to the game.\n");127 DebugPrintf( "Type 'help' to see a little list of commands and variables.\n");127 DebugPrintf(_("Debugger started, type 'exit' to return to the game.\n")); 128 DebugPrintf(_("Type 'help' to see a little list of commands and variables.\n")); 128 129 _firstTime = false; 129 130 } 130 131 131 132 if (_errStr) { 132 DebugPrintf( "ERROR: %s\n\n", _errStr);133 DebugPrintf(_("ERROR: %s\n\n"), _errStr); 133 134 free(_errStr); 134 135 _errStr = NULL; 135 136 } … … 146 147 // and tab completion of the console. It would still require a lot of 147 148 // work, but at least no dependency on a 3rd party library... 148 149 149 printf( "Debugger entered, please switch to this console for input.\n");150 printf(_t("Debugger entered, please switch to this console for input.\n")); 150 151 151 152 int i; 152 153 char buf[256]; … … 222 223 case DVAR_INTARRAY: { 223 224 char *chr = (char *)strchr(param[0], '['); 224 225 if (!chr) { 225 DebugPrintf( "You must access this array as %s[element]\n", param[0]);226 DebugPrintf(_("You must access this array as %s[element]\n"), param[0]); 226 227 } else { 227 228 int element = atoi(chr+1); 228 229 int32 *var = *(int32 **)_dvars[i].variable; 229 230 if (element >= _dvars[i].optional) { 230 DebugPrintf( "%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);231 DebugPrintf(_("%s is out of range (array is %d elements big)\n"), param[0], _dvars[i].optional); 231 232 } else { 232 233 var[element] = atoi(param[1]); 233 234 DebugPrintf("(int)%s = %d\n", param[0], var[element]); … … 236 237 } 237 238 break; 238 239 default: 239 DebugPrintf( "Failed to set variable %s to %s - unknown type\n", _dvars[i].name, param[1]);240 DebugPrintf(_("Failed to set variable %s to %s - unknown type\n"), _dvars[i].name, param[1]); 240 241 break; 241 242 } 242 243 } else { … … 253 254 case DVAR_INTARRAY: { 254 255 const char *chr = strchr(param[0], '['); 255 256 if (!chr) { 256 DebugPrintf( "You must access this array as %s[element]\n", param[0]);257 DebugPrintf(_("You must access this array as %s[element]\n"), param[0]); 257 258 } else { 258 259 int element = atoi(chr+1); 259 260 const int32 *var = *(const int32 **)_dvars[i].variable; 260 261 if (element >= _dvars[i].optional) { 261 DebugPrintf( "%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);262 DebugPrintf(_("%s is out of range (array is %d elements big)\n"), param[0], _dvars[i].optional); 262 263 } else { 263 264 DebugPrintf("(int)%s = %d\n", param[0], var[element]); 264 265 } … … 270 271 DebugPrintf("(string)%s = %s\n", param[0], ((Common::String *)_dvars[i].variable)->c_str()); 271 272 break; 272 273 default: 273 DebugPrintf( "%s = (unknown type)\n", param[0]);274 DebugPrintf(_("%s = (unknown type)\n"), param[0]); 274 275 break; 275 276 } 276 277 } … … 280 281 } 281 282 } 282 283 283 DebugPrintf( "Unknown command or variable\n");284 DebugPrintf(_("Unknown command or variable\n")); 284 285 free(input); 285 286 return true; 286 287 } … … 370 371 const int charsPerLine = _debuggerDialog->getCharsPerLine(); 371 372 int width, size, i; 372 373 373 DebugPrintf( "Commands are:\n");374 DebugPrintf(_("Commands are:\n")); 374 375 width = 0; 375 376 for (i = 0; i < _dcmd_count; i++) { 376 377 size = strlen(_dcmds[i].name) + 1; … … 387 388 388 389 if (_dvar_count > 0) { 389 390 DebugPrintf("\n"); 390 DebugPrintf( "Variables are:\n");391 DebugPrintf(_("Variables are:\n")); 391 392 width = 0; 392 393 for (i = 0; i < _dvar_count; i++) { 393 394 size = strlen(_dvars[i].name) + 1; … … 409 410 bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) { 410 411 const Common::Array<Common::EngineDebugLevel> &debugLevels = Common::listSpecialDebugLevels(); 411 412 412 DebugPrintf( "Engine debug levels:\n");413 DebugPrintf( "--------------------\n");413 DebugPrintf(_("Engine debug levels:\n")); 414 DebugPrintf(_("--------------------\n")); 414 415 if (!debugLevels.size()) { 415 DebugPrintf( "No engine debug levels\n");416 DebugPrintf(_("No engine debug levels\n")); 416 417 return true; 417 418 } 418 419 for (uint i = 0; i < debugLevels.size(); ++i) { … … 424 425 425 426 bool Debugger::Cmd_DebugFlagEnable(int argc, const char **argv) { 426 427 if (argc < 2) { 427 DebugPrintf( "debugflag_enable <flag>\n");428 DebugPrintf(_("debugflag_enable <flag>\n")); 428 429 } else { 429 430 if (Common::enableSpecialDebugLevel(argv[1])) { 430 DebugPrintf( "Enabled debug flag '%s'\n", argv[1]);431 DebugPrintf(_("Enabled debug flag '%s'\n"), argv[1]); 431 432 } else { 432 DebugPrintf( "Failed to enable debug flag '%s'\n", argv[1]);433 DebugPrintf(_("Failed to enable debug flag '%s'\n"), argv[1]); 433 434 } 434 435 } 435 436 return true; … … 437 438 438 439 bool Debugger::Cmd_DebugFlagDisable(int argc, const char **argv) { 439 440 if (argc < 2) { 440 DebugPrintf( "debugflag_disable <flag>\n");441 DebugPrintf(_("debugflag_disable <flag>\n")); 441 442 } else { 442 443 if (Common::disableSpecialDebugLevel(argv[1])) { 443 DebugPrintf( "Disabled debug flag '%s'\n", argv[1]);444 DebugPrintf(_("Disabled debug flag '%s'\n"), argv[1]); 444 445 } else { 445 DebugPrintf( "Failed to disable debug flag '%s'\n", argv[1]);446 DebugPrintf(_("Failed to disable debug flag '%s'\n"), argv[1]); 446 447 } 447 448 } 448 449 return true; -
common/file.cpp
28 28 #include "common/hashmap.h" 29 29 #include "common/util.h" 30 30 #include "common/hash-str.h" 31 #include "common/translation.h" 31 32 32 33 #ifdef MACOSX 33 34 #include "CoreFoundation/CoreFoundation.h" … … 275 276 276 277 File::~File() { 277 278 #ifdef DEBUG_FILE_REFCOUNT 278 warning( "File::~File on file '%s'", _name.c_str());279 warning(_t("File::~File on file '%s'"), _name.c_str()); 279 280 #endif 280 281 close(); 281 282 } … … 285 286 assert(mode == kFileReadMode || mode == kFileWriteMode); 286 287 287 288 if (filename.empty()) { 288 error( "File::open: No filename was specified");289 error(_t("File::open: No filename was specified")); 289 290 } 290 291 291 292 if (_handle) { 292 error( "File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), filename.c_str());293 error(_t("File::open: This file object already is opened (%s), won't open '%s'"), _name.c_str(), filename.c_str()); 293 294 } 294 295 295 296 _name.clear(); … … 303 304 _handle = fopenNoCase(filename, "", modeStr); 304 305 } else if (_filesMap && _filesMap->contains(fname)) { 305 306 fname = (*_filesMap)[fname]; 306 debug(3, "Opening hashed: %s", fname.c_str());307 debug(3, _t("Opening hashed: %s"), fname.c_str()); 307 308 _handle = fopen(fname.c_str(), modeStr); 308 309 } else if (_filesMap && _filesMap->contains(fname + ".")) { 309 310 // WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails" 310 311 // sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot) 311 312 fname = (*_filesMap)[fname + "."]; 312 debug(3, "Opening hashed: %s", fname.c_str());313 debug(3, _t("Opening hashed: %s"), fname.c_str()); 313 314 _handle = fopen(fname.c_str(), modeStr); 314 315 } else { 315 316 … … 345 346 346 347 if (_handle == NULL) { 347 348 if (mode == kFileReadMode) 348 debug(2, "File %s not found", filename.c_str());349 debug(2, _t("File %s not found"), filename.c_str()); 349 350 else 350 debug(2, "File %s not opened", filename.c_str());351 debug(2, _t("File %s not opened"), filename.c_str()); 351 352 return false; 352 353 } 353 354 … … 355 356 _name = filename; 356 357 357 358 #ifdef DEBUG_FILE_REFCOUNT 358 warning( "File::open on file '%s'", _name.c_str());359 warning(_t("File::open on file '%s'"), _name.c_str()); 359 360 #endif 360 361 361 362 return true; … … 365 366 assert(mode == kFileReadMode || mode == kFileWriteMode); 366 367 367 368 if (!node.isValid()) { 368 warning( "File::open: Trying to open an invalid FilesystemNode object");369 warning(_t("File::open: Trying to open an invalid FilesystemNode object")); 369 370 return false; 370 371 } else if (node.isDirectory()) { 371 warning( "File::open: Trying to open a FilesystemNode which is a directory");372 warning(_t("File::open: Trying to open a FilesystemNode which is a directory")); 372 373 return false; 373 374 } 374 375 375 376 String filename(node.name()); 376 377 377 378 if (_handle) { 378 error( "File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), filename.c_str());379 error(_t("File::open: This file object already is opened (%s), won't open '%s'"), _name.c_str(), filename.c_str()); 379 380 } 380 381 381 382 clearIOFailed(); … … 387 388 388 389 if (_handle == NULL) { 389 390 if (mode == kFileReadMode) 390 debug(2, "File %s not found", filename.c_str());391 debug(2, _t("File %s not found"), filename.c_str()); 391 392 else 392 debug(2, "File %s not opened", filename.c_str());393 debug(2, _t("File %s not opened"), filename.c_str()); 393 394 return false; 394 395 } 395 396 396 397 _name = filename; 397 398 398 399 #ifdef DEBUG_FILE_REFCOUNT 399 warning( "File::open on file '%s'", _name.c_str());400 warning(_t("File::open on file '%s'"), _name.c_str()); 400 401 #endif 401 402 402 403 return true; … … 456 457 457 458 bool File::eof() const { 458 459 if (_handle == NULL) { 459 error( "File::eof: File is not open!");460 error(_t("File::eof: File is not open!")); 460 461 return false; 461 462 } 462 463 … … 465 466 466 467 uint32 File::pos() const { 467 468 if (_handle == NULL) { 468 error( "File::pos: File is not open!");469 error(_t("File::pos: File is not open!")); 469 470 return 0; 470 471 } 471 472 … … 474 475 475 476 uint32 File::size() const { 476 477 if (_handle == NULL) { 477 error( "File::size: File is not open!");478 error(_t("File::size: File is not open!")); 478 479 return 0; 479 480 } 480 481 … … 488 489 489 490 void File::seek(int32 offs, int whence) { 490 491 if (_handle == NULL) { 491 error( "File::seek: File is not open!");492 error(_t("File::seek: File is not open!")); 492 493 return; 493 494 } 494 495 … … 501 502 uint32 real_len; 502 503 503 504 if (_handle == NULL) { 504 error( "File::read: File is not open!");505 error(_t("File::read: File is not open!")); 505 506 return 0; 506 507 } 507 508 … … 518 519 519 520 uint32 File::write(const void *ptr, uint32 len) { 520 521 if (_handle == NULL) { 521 error( "File::write: File is not open!");522 error(_t("File::write: File is not open!")); 522 523 return 0; 523 524 } 524 525 -
common/advancedDetector.cpp
33 33 #include "common/md5.h" 34 34 #include "common/advancedDetector.h" 35 35 #include "common/config-manager.h" 36 #include "common/translation.h" 36 37 37 38 namespace Common { 38 39 … … 66 67 } 67 68 g++; 68 69 } 69 error( "Engine %s doesn't have its singleid specified in ids list", params.singleid);70 error(_t("Engine %s doesn't have its singleid specified in ids list"), params.singleid); 70 71 } 71 72 72 73 return GameList(params.list); … … 86 87 if (o->platform != Common::kPlatformUnknown) 87 88 ConfMan.set("platform", Common::getPlatformCode(o->platform)); 88 89 89 warning( "Target upgraded from %s to %s", o->from, o->to);90 warning(_t("Target upgraded from %s to %s"), o->from, o->to); 90 91 91 92 if (ConfMan.hasKey("id_came_from_command_line")) { 92 warning( "Target came from command line. Skipping save");93 warning(_t("Target came from command line. Skipping save")); 93 94 } else { 94 95 ConfMan.flushToDisk(); 95 96 } … … 116 117 if (0 == scumm_stricmp(gameid, o->from)) { 117 118 g = findPlainGameDescriptor(o->to, list); 118 119 if (g && g->description) 119 return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")");120 return GameDescriptor(gameid, _t("Obsolete game ID (") + Common::String(g->description) + _t(")")); 120 121 else 121 return GameDescriptor(gameid, "Obsolete game ID");122 return GameDescriptor(gameid, _t("Obsolete game ID")); 122 123 } 123 124 o++; 124 125 } … … 260 261 } 261 262 262 263 if (result.realDesc != 0) { 263 debug(2, "Running %s", toGameDescriptor(result, params.list).description().c_str());264 debug(2, _t("Running %s"), toGameDescriptor(result, params.list).description().c_str()); 264 265 } 265 266 266 267 return result; … … 325 326 const ADGameDescription *g; 326 327 const byte *descPtr; 327 328 328 debug(3, "Starting detection");329 debug(3, _t("Starting detection")); 329 330 330 331 // First we compose list of files which we need MD5s for 331 332 for (descPtr = params.descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += params.descItemSize) { … … 415 416 } 416 417 if (fileDesc->md5 != NULL) { 417 418 if (fileDesc->md5 != filesMD5[tstr]) { 418 debug(3, "MD5 Mismatch. Skipping (%s) (%s)", fileDesc->md5, filesMD5[tstr].c_str());419 debug(3, _t("MD5 Mismatch. Skipping (%s) (%s)"), fileDesc->md5, filesMD5[tstr].c_str()); 419 420 fileMissing = true; 420 421 break; 421 422 } … … 423 424 424 425 if (fileDesc->fileSize != -1) { 425 426 if (fileDesc->fileSize != filesSize[tstr]) { 426 debug(3, "Size Mismatch. Skipping");427 debug(3, _t("Size Mismatch. Skipping")); 427 428 fileMissing = true; 428 429 break; 429 430 } 430 431 } 431 432 432 debug(3, "Matched file: %s", tstr.c_str());433 debug(3, _t("Matched file: %s"), tstr.c_str()); 433 434 } 434 435 if (!fileMissing) { 435 debug(2, "Found game: %s (%s %s/%s) (%d)", g->gameid, g->extra,436 debug(2, _t("Found game: %s (%s %s/%s) (%d)"), g->gameid, g->extra, 436 437 getPlatformDescription(g->platform), getLanguageDescription(g->language), i); 437 438 438 439 // Count the number of matching files. Then, only keep those … … 442 443 curFilesMatched++; 443 444 444 445 if (curFilesMatched > maxFilesMatched) { 445 debug(2, " ... new best match, removing all previous candidates");446 debug(2, _t(" ... new best match, removing all previous candidates")); 446 447 maxFilesMatched = curFilesMatched; 447 448 matched.clear(); 448 449 matched.push_back(g); 449 450 } else if (curFilesMatched == maxFilesMatched) { 450 451 matched.push_back(g); 451 452 } else { 452 debug(2, " ... skipped");453 debug(2, _t(" ... skipped")); 453 454 } 454 455 455 456 } else { 456 debug(5, "Skipping game: %s (%s %s/%s) (%d)", g->gameid, g->extra,457 debug(5, _t("Skipping game: %s (%s %s/%s) (%d)"), g->gameid, g->extra, 457 458 getPlatformDescription(g->platform), getLanguageDescription(g->language), i); 458 459 } 459 460 } … … 468 469 // 469 470 // Might also be helpful to display the full path (for when this is used 470 471 // from the mass detector). 471 printf( "Your game version appears to be unknown. Please, report the following\n");472 printf("data to the ScummVM team along with name of the game you tried to add\n");473 printf("and its version/language/etc.:\n");472 printf(_t("Your game version appears to be unknown. Please, report the following\n" 473 "data to the ScummVM team along with name of the game you tried to add\n" 474 "and its version/language/etc.:\n")); 474 475 475 476 for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file) 476 477 printf(" \"%s\", \"%s\", %d\n", file->_key.c_str(), file->_value.c_str(), filesSize[file->_key]); … … 532 533 } 533 534 534 535 if (!fileMissing) 535 debug(4, "Matched: %s", agdesc->gameid);536 debug(4, _t("Matched: %s"), agdesc->gameid); 536 537 537 538 if (!fileMissing && numMatchedFiles > maxNumMatchedFiles) { 538 539 matchedDesc = agdesc; 539 540 maxNumMatchedFiles = numMatchedFiles; 540 541 541 debug(4, "and overriden");542 debug(4, _t("and overriden")); 542 543 } 543 544 } 544 545 545 546 if (matchedDesc) { // We got a match 546 547 matched.push_back(matchedDesc); 547 548 if (params.flags & kADFlagPrintWarningOnFileBasedFallback) { 548 printf( "Your game version has been detected using filename matching as a\n");549 printf("variant of %s.\n", matchedDesc->gameid);550 printf( "If this is an original and unmodified version, please report any\n");551 printf("information previously printed by ScummVM to the team.\n");549 printf(_t("Your game version has been detected using filename matching as a\n" 550 "variant of %s.\n"), matchedDesc->gameid); 551 printf(_t("If this is an original and unmodified version, please report any\n" 552 "information previously printed by ScummVM to the team.\n")); 552 553 } 553 554 } 554 555 } -
common/mutex.cpp
26 26 #include "common/stdafx.h" 27 27 #include "common/mutex.h" 28 28 #include "common/system.h" 29 #include "common/translation.h" 29 30 30 31 namespace Common { 31 32 … … 65 66 66 67 void StackLock::lock() { 67 68 if (_mutexName != NULL) 68 debug(6, "Locking mutex %s", _mutexName);69 debug(6, _t("Locking mutex %s"), _mutexName); 69 70 70 71 g_system->lockMutex(_mutex); 71 72 } 72 73 73 74 void StackLock::unlock() { 74 75 if (_mutexName != NULL) 75 debug(6, "Unlocking mutex %s", _mutexName);76 debug(6, _t("Unlocking mutex %s"), _mutexName); 76 77 77 78 g_system->unlockMutex(_mutex); 78 79 } -
common/iff_container.h
30 30 #include "common/endian.h" 31 31 #include "common/stream.h" 32 32 #include "common/util.h" 33 #include "common/translation.h" 33 34 34 35 namespace Common { 35 36 … … 163 164 void incBytesRead(uint32 inc) { 164 165 bytesRead += inc; 165 166 if (bytesRead > size) { 166 error( "Chunk overead");167 error(_t("Chunk overead")); 167 168 } 168 169 } 169 170 … … 199 200 IFFParser(Common::ReadStream &input) : _formChunk(&input), _chunk(&input) { 200 201 _formChunk.readHeader(); 201 202 if (_formChunk.id != ID_FORM) { 202 error( "IFFDecoder input is not a FORM type IFF file");203 error(_t("IFFDecoder input is not a FORM type IFF file")); 203 204 } 204 205 _typeId = _formChunk.readUint32BE(); 205 206 } -
common/config-manager.cpp
34 34 #include "common/config-manager.h" 35 35 #include "common/file.h" 36 36 #include "common/util.h" 37 #include "common/translation.h" 37 38 38 39 DECLARE_SINGLETON(Common::ConfigManager); 39 40 … … 101 102 // Use the Application Data directory of the user profile. 102 103 if (win32OsVersion.dwMajorVersion >= 5) { 103 104 if (!GetEnvironmentVariable("APPDATA", configFile, sizeof(configFile))) 104 error( "Unable to access application data directory");105 error(_t("Unable to access application data directory")); 105 106 } else { 106 107 if (!GetEnvironmentVariable("USERPROFILE", configFile, sizeof(configFile))) 107 error( "Unable to access user profile directory");108 error(_t("Unable to access user profile directory")); 108 109 109 110 strcat(configFile, "\\Application Data"); 110 111 CreateDirectory(configFile, NULL); … … 120 121 GetWindowsDirectory(oldConfigFile, MAXPATHLEN); 121 122 strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE); 122 123 if (fopen(oldConfigFile, "r")) { 123 printf( "The default location of the config file (scummvm.ini) in ScummVM has changed,\n");124 printf("under Windows NT4/2000/XP/Vista. You may want to consider moving your config\n");125 printf("file from the old default location:\n");126 printf("%s\n", oldConfigFile);127 printf("to the new default location:\n");128 printf("%s\n\n", configFile);124 printf(_t("The default location of the config file (scummvm.ini) in ScummVM has changed,\n" 125 "under Windows NT4/2000/XP/Vista. You may want to consider moving your config\n" 126 "file from the old default location:\n" 127 "%s\n" 128 "to the new default location:\n" 129 "%s\n\n"), oldConfigFile, configFile); 129 130 strcpy(configFile, oldConfigFile); 130 131 } 131 132 } … … 161 162 _filename = filename; 162 163 _domainSaveOrder.clear(); 163 164 loadFile(_filename); 164 printf( "Using configuration file: %s\n", _filename.c_str());165 printf(_t("Using configuration file: %s\n"), _filename.c_str()); 165 166 } 166 167 167 168 void ConfigManager::loadFile(const String &filename) { 168 169 File cfg_file; 169 170 170 171 if (!cfg_file.open(filename)) { 171 printf( "Creating configuration file: %s\n", filename.c_str());172 printf(_t("Creating configuration file: %s\n"), filename.c_str()); 172 173 } else { 173 174 char buf[MAXLINELEN]; 174 175 String domain; … … 200 201 201 202 switch (*p) { 202 203 case '\0': 203 error( "Config file buggy: missing ] in line %d", lineno);204 error(_t("Config file buggy: missing ] in line %d"), lineno); 204 205 break; 205 206 case ']': 206 207 *p = 0; 207 208 domain = buf + 1; 208 209 break; 209 210 default: 210 error( "Config file buggy: Invalid character '%c' occured in domain name in line %d", *p, lineno);211 error(_t("Config file buggy: Invalid character '%c' occured in domain name in line %d"), *p, lineno); 211 212 } 212 213 213 214 // Store domain comment … … 229 230 230 231 // If no domain has been set, this config file is invalid! 231 232 if (domain.empty()) { 232 error( "Config file buggy: Key/value pair found outside a domain in line %d", lineno);233 error(_t("Config file buggy: Key/value pair found outside a domain in line %d"), lineno); 233 234 } 234 235 235 236 // Split string at '=' into 'key' and 'value'. 236 237 char *p = strchr(t, '='); 237 238 if (!p) 238 error( "Config file buggy: Junk found in line line %d: '%s'", lineno, t);239 error(_t("Config file buggy: Junk found in line line %d: '%s'"), lineno, t); 239 240 *p = 0; 240 241 String key = rtrim(t); 241 242 String value = ltrim(p + 1); … … 262 263 // return; 263 264 264 265 if (!cfg_file.open(_filename, File::kFileWriteMode)) { 265 warning( "Unable to write configuration file: %s", _filename.c_str());266 warning(_t("Unable to write configuration file: %s"), _filename.c_str()); 266 267 } else { 267 268 268 269 // First write the domains in _domainSaveOrder, in that order. … … 399 400 Domain *domain = getDomain(domName); 400 401 401 402 if (!domain) 402 error( "ConfigManager::removeKey(%s, %s) called on non-existent domain",403 error(_t("ConfigManager::removeKey(%s, %s) called on non-existent domain"), 403 404 key.c_str(), domName.c_str()); 404 405 405 406 domain->erase(key); … … 436 437 const Domain *domain = getDomain(domName); 437 438 438 439 if (!domain) 439 error( "ConfigManager::get(%s,%s) called on non-existent domain",440 error(_t("ConfigManager::get(%s,%s) called on non-existent domain"), 440 441 key.c_str(), domName.c_str()); 441 442 442 443 if (domain->contains(key)) … … 452 453 return ConfMan._emptyString; 453 454 #endif 454 455 #else 455 error( "ConfigManager::get(%s,%s) called on non-existent key",456 error(_t("ConfigManager::get(%s,%s) called on non-existent key"), 456 457 key.c_str(), domName.c_str()); 457 458 #endif 458 459 } … … 475 476 // values ("123") are still valid. 476 477 int ivalue = (int)strtol(value.c_str(), &errpos, 0); 477 478 if (value.c_str() == errpos) 478 error( "ConfigManager::getInt(%s,%s): '%s' is not a valid integer",479 error(_t("ConfigManager::getInt(%s,%s): '%s' is not a valid integer"), 479 480 key.c_str(), domName.c_str(), errpos); 480 481 481 482 return ivalue; … … 489 490 if ((value == "false") || (value == "no") || (value == "0")) 490 491 return false; 491 492 492 error( "ConfigManager::getBool(%s,%s): '%s' is not a valid bool",493 error(_t("ConfigManager::getBool(%s,%s): '%s' is not a valid bool"), 493 494 key.c_str(), domName.c_str(), value.c_str()); 494 495 } 495 496 … … 521 522 Domain *domain = getDomain(domName); 522 523 523 524 if (!domain) 524 error( "ConfigManager::set(%s,%s,%s) called on non-existent domain",525 error(_t("ConfigManager::set(%s,%s,%s) called on non-existent domain"), 525 526 key.c_str(), value.c_str(), domName.c_str()); 526 527 527 528 (*domain)[key] = value; -
common/util.cpp
27 27 #include "common/util.h" 28 28 #include "common/system.h" 29 29 #include "gui/debugger.h" 30 #include "common/translation.h" 30 31 31 32 #ifdef _WIN32_WCE 32 33 // This is required for the debugger attachment … … 147 148 148 149 149 150 const LanguageDescription g_languages[] = { 150 {"zh", "Chinese (Taiwan)", ZH_TWN},151 {"cz", "Czech", CZ_CZE},152 {"nl", "Dutch", NL_NLD},153 {"en", "English", EN_ANY}, // Generic English (when only one game version exist)154 {"gb", "English (GB)", EN_GRB},155 {"us", "English (US)", EN_USA},156 {"fr", "French", FR_FRA},157 {"de", "German", DE_DEU},158 {"hb", "Hebrew", HB_ISR},159 {"it", "Italian", IT_ITA},160 {"jp", "Japanese", JA_JPN},161 {"kr", "Korean", KO_KOR},162 {"nb", "Norwegian Bokm\xE5l", NB_NOR},163 {"pl", "Polish", PL_POL},164 {"br", "Portuguese", PT_BRA},165 {"ru", "Russian", RU_RUS},166 {"es", "Spanish", ES_ESP},167 {"se", "Swedish", SE_SWE},151 {"zh", _("Chinese (Taiwan)"), ZH_TWN}, 152 {"cz", _("Czech"), CZ_CZE}, 153 {"nl", _("Dutch"), NL_NLD}, 154 {"en", _("English"), EN_ANY}, // Generic English (when only one game version exist) 155 {"gb", _("English (GB)"), EN_GRB}, 156 {"us", _("English (US)"), EN_USA}, 157 {"fr", _("French"), FR_FRA}, 158 {"de", _("German"), DE_DEU}, 159 {"hb", _("Hebrew"), HB_ISR}, 160 {"it", _("Italian"), IT_ITA}, 161 {"jp", _("Japanese"), JA_JPN}, 162 {"kr", _("Korean"), KO_KOR}, 163 {"nb", _("Norwegian Bokm\xE5l"), NB_NOR}, 164 {"pl", _("Polish"), PL_POL}, 165 {"br", _("Portuguese"), PT_BRA}, 166 {"ru", _("Russian"), RU_RUS}, 167 {"es", _("Spanish"), ES_ESP}, 168 {"se", _("Swedish"), SE_SWE}, 168 169 {0, 0, UNK_LANG} 169 170 }; 170 171 … … 205 206 206 207 207 208 const PlatformDescription g_platforms[] = { 208 {"2gs", "2gs", "2gs", "Apple IIgs", kPlatformApple2GS },209 {"3do", "3do", "3do", "3DO", kPlatform3DO},210 {"acorn", "acorn", "acorn", "Acorn", kPlatformAcorn},211 {"amiga", "ami", "amiga", "Amiga", kPlatformAmiga},212 {"atari", "atari-st", "st", "Atari ST", kPlatformAtariST},213 {"c64", "c64", "c64", "Commodore 64", kPlatformC64},214 {"pc", "dos", "ibm", "DOS", kPlatformPC},209 {"2gs", "2gs", "2gs", _("Apple IIgs"), kPlatformApple2GS }, 210 {"3do", "3do", "3do", _("3DO"), kPlatform3DO}, 211 {"acorn", "acorn", "acorn", _("Acorn"), kPlatformAcorn}, 212 {"amiga", "ami", "amiga", _("Amiga"), kPlatformAmiga}, 213 {"atari", "atari-st", "st", _("Atari ST"), kPlatformAtariST}, 214 {"c64", "c64", "c64", _("Commodore 64"), kPlatformC64}, 215 {"pc", "dos", "ibm", _("DOS"), kPlatformPC}, 215 216 216 217 // The 'official' spelling seems to be "FM-TOWNS" (e.g. in the Indy4 demo). 217 218 // However, on the net many variations can be seen, like "FMTOWNS", 218 219 // "FM TOWNS", "FmTowns", etc. 219 {"fmtowns", "towns", "fm", "FM-TOWNS", kPlatformFMTowns},220 {"fmtowns", "towns", "fm", _("FM-TOWNS"), kPlatformFMTowns}, 220 221 221 {"linux", "linux", "linux", "Linux", kPlatformLinux},222 {"macintosh", "mac", "mac", "Macintosh", kPlatformMacintosh},223 {"pce", "pce", "pce", "PC-Engine", kPlatformPCEngine },224 {"nes", "nes", "nes", "NES", kPlatformNES},225 {"segacd", "segacd", "sega", "SegaCD", kPlatformSegaCD},226 {"windows", "win", "win", "Windows", kPlatformWindows},222 {"linux", "linux", "linux", _("Linux"), kPlatformLinux}, 223 {"macintosh", "mac", "mac", _("Macintosh"), kPlatformMacintosh}, 224 {"pce", "pce", "pce", _("PC-Engine"), kPlatformPCEngine }, 225 {"nes", "nes", "nes", _("NES"), kPlatformNES}, 226 {"segacd", "segacd", "sega", _("SegaCD"), kPlatformSegaCD}, 227 {"windows", "win", "win", _("Windows"), kPlatformWindows}, 227 228 228 229 229 {0, 0, 0, "Default", kPlatformUnknown}230 {0, 0, 0, _("Default"), kPlatformUnknown} 230 231 }; 231 232 232 233 Platform parsePlatform(const String &str) { … … 286 287 287 288 288 289 const RenderModeDescription g_renderModes[] = { 289 {"hercGreen", "Hercules Green", kRenderHercG},290 {"hercAmber", "Hercules Amber", kRenderHercA},291 {"cga", "CGA", kRenderCGA},292 {"ega", "EGA", kRenderEGA},293 {"amiga", "Amiga", kRenderAmiga},290 {"hercGreen", _("Hercules Green"), kRenderHercG}, 291 {"hercAmber", _("Hercules Amber"), kRenderHercA}, 292 {"cga", _("CGA"), kRenderCGA}, 293 {"ega", _("EGA"), kRenderEGA}, 294 {"amiga", _("Amiga"), kRenderAmiga}, 294 295 {0, 0, kRenderDefault} 295 296 }; 296 297 … … 334 335 bool addSpecialDebugLevel(uint32 level, const String &option, const String &description) { 335 336 for (uint i = 0; i < gDebugLevels.size(); ++i) { 336 337 if (!scumm_stricmp(option.c_str(), gDebugLevels[i].option.c_str())) { 337 warning( "Declared engine debug level '%s' again", option.c_str());338 warning(_t("Declared engine debug level '%s' again"), option.c_str()); 338 339 gDebugLevels[i] = EngineDebugLevel(level, option, description); 339 340 return true; 340 341 } … … 367 368 for (end = start + 1; end <= option.size(); ++end) { 368 369 if (str[end] == ',' || end == option.size()) { 369 370 if (!enableSpecialDebugLevel(Common::String(&str[start], end-start))) { 370 warning( "Engine does not support debug level '%s'", Common::String(&str[start], end-start).c_str());371 warning(_t("Engine does not support debug level '%s'"), Common::String(&str[start], end-start).c_str()); 371 372 } 372 373 start = end + 1; 373 374 } … … 512 513 513 514 // Print the error message to stderr 514 515 #ifdef __GP32__ 515 printf( "ERROR: %s\n", buf_output);516 printf(_t("ERROR: %s\n"), buf_output); 516 517 #else 517 518 fprintf(stderr, "%s!\n", buf_output); 518 519 #endif … … 575 576 va_end(va); 576 577 577 578 #ifdef __GP32__ //ph0x FIXME: implement fprint? 578 printf( "WARNING: %s\n", buf);579 printf(_t("WARNING: %s\n"), buf); 579 580 #else 580 581 #if !defined (__SYMBIAN32__) 581 fprintf(stderr, "WARNING: %s!\n", buf);582 fprintf(stderr, _t("WARNING: %s!\n"), buf); 582 583 #endif 583 584 #endif 584 585 #if defined( USE_WINDBG ) -
common/config-file.cpp
30 30 #include "common/savefile.h" 31 31 #include "common/system.h" 32 32 #include "common/util.h" 33 #include "common/translation.h" 33 34 34 35 #define MAXLINELEN 256 35 36 … … 119 120 p++; 120 121 121 122 if (*p == '\0') 122 error( "ConfigFile::loadFromStream: missing ] in line %d", lineno);123 error(_t("ConfigFile::loadFromStream: missing ] in line %d"), lineno); 123 124 else if (*p != ']') 124 error( "ConfigFile::loadFromStream: Invalid character '%c' occured in section name in line %d", *p, lineno);125 error(_t("ConfigFile::loadFromStream: Invalid character '%c' occured in section name in line %d"), *p, lineno); 125 126 126 127 *p = 0; 127 128 … … 145 146 146 147 // If no section has been set, this config file is invalid! 147 148 if (section.name.empty()) { 148 error( "ConfigFile::loadFromStream: Key/value pair found outside a section in line %d", lineno);149 error(_t("ConfigFile::loadFromStream: Key/value pair found outside a section in line %d"), lineno); 149 150 } 150 151 151 152 // Split string at '=' into 'key' and 'value'. 152 153 char *p = strchr(t, '='); 153 154 if (!p) 154 error( "ConfigFile::loadFromStream: Junk found in line line %d: '%s'", lineno, t);155 error(_t("ConfigFile::loadFromStream: Junk found in line line %d: '%s'"), lineno, t); 155 156 *p = 0; 156 157 157 158 kv.key = rtrim(t); -
common/md5.cpp
32 32 #include "common/md5.h" 33 33 #include "common/util.h" 34 34 #include "common/endian.h" 35 #include "common/translation.h" 35 36 36 37 namespace Common { 37 38 … … 247 248 248 249 bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) { 249 250 if (!file.isValid()) { 250 warning( "md5_file: using an invalid FilesystemNode");251 warning(_t("md5_file: using an invalid FilesystemNode")); 251 252 return false; 252 253 } else if (file.isDirectory()) { 253 warning( "md5_file: using a diretory FilesystemNode");254 warning(_t("md5_file: using a diretory FilesystemNode")); 254 255 return false; 255 256 } 256 257 … … 262 263 263 264 f.open(name); 264 265 if (!f.isOpen()) { 265 warning( "md5_file couldn't open '%s'", name);266 warning(_t("md5_file couldn't open '%s'"), name); 266 267 return false; 267 268 } 268 269 … … 379 380 unsigned char md5sum[16]; 380 381 381 382 if (argc < 2) { 382 printf( "\n MD5 Validation Tests:\n\n");383 printf(_t("\n MD5 Validation Tests:\n\n")); 383 384 384 385 for (i = 0; i < 7; i++) { 385 printf( " Test %d ", i + 1);386 printf(_t(" Test %d "), i + 1); 386 387 387 388 md5_starts(&ctx); 388 389 md5_update(&ctx, (const uint8 *)msg[i], strlen(msg[i])); … … 393 394 } 394 395 395 396 if (memcmp(output, val[i], 32)) { 396 printf( "failed!\n");397 printf(_t("failed!\n")); 397 398 return 1; 398 399 } 399 400 400 printf( "passed.\n");401 printf(_t("passed.\n")); 401 402 } 402 403 403 404 printf("\n"); -
common/hashmap.h
360 360 361 361 #ifdef DEBUG_HASH_COLLISIONS 362 362 _lookups++; 363 fprintf(stderr, "collisions %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d\n",363 fprintf(stderr, _t("collisions %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d\n"), 364 364 _collisions, _lookups, ((double) _collisions / (double)_lookups), 365 365 (const void *)this, _arrsize, _nele); 366 366 #endif -
graphics/mpeg_player.cpp
29 29 #include "common/system.h" 30 30 #include "common/util.h" 31 31 #include "graphics/scaler/intern.h" 32 #include "common/translation.h" 32 33 33 34 namespace Graphics { 34 35 … … 131 132 _mpegFile = new Common::File(); 132 133 sprintf(tempFile, "%s.mp2", name); 133 134 if (!_mpegFile->open(tempFile)) { 134 warning( "Cutscene: Could not open %s", tempFile);135 warning(_t("Cutscene: Could not open %s"), tempFile); 135 136 return false; 136 137 } 137 138 138 139 // Load and configure decoder 139 140 _mpegDecoder = mpeg2_init(); 140 141 if (_mpegDecoder == NULL) { 141 warning( "Cutscene: Could not allocate an MPEG2 decoder");142 warning(_t("Cutscene: Could not allocate an MPEG2 decoder")); 142 143 return false; 143 144 } 144 145 -
graphics/iff.cpp
26 26 #include "graphics/surface.h" 27 27 28 28 #include "common/util.h" 29 #include "common/translation.h" 29 30 30 31 31 32 namespace Common { … … 70 71 71 72 ILBMDecoder::ILBMDecoder(Common::ReadStream &input, Surface &surface, byte *&colors) : IFFParser(input), _surface(&surface), _colors(&colors) { 72 73 if (_typeId != ID_ILBM) 73 error( "unsupported IFF subtype '%s'", Common::ID2string(_typeId));74 error(_t("unsupported IFF subtype '%s'"), Common::ID2string(_typeId)); 74 75 } 75 76 76 77 void ILBMDecoder::decode() { … … 107 108 108 109 void ILBMDecoder::readCMAP(Common::IFFChunk &chunk) { 109 110 if (*_colors == NULL) { 110 error( "wrong input chunk sequence");111 error(_t("wrong input chunk sequence")); 111 112 } 112 113 for (uint32 i = 0; i < _colorCount; i++) { 113 114 (*_colors)[i * 3 + 0] = chunk.readByte(); … … 120 121 121 122 switch (_bitmapHeader.pack) { 122 123 case 0: 123 error( "unpacked ILBM files are not supported");124 error(_t("unpacked ILBM files are not supported")); 124 125 break; 125 126 126 127 case 1: { … … 166 167 167 168 PBMDecoder::PBMDecoder(Common::ReadStream &input, Surface &surface, byte *&colors) : IFFParser(input), _surface(&surface), _colors(&colors) { 168 169 if (_typeId != ID_PBM) 169 error( "unsupported IFF subtype '%s'", Common::ID2string(_typeId));170 error(_t("unsupported IFF subtype '%s'"), Common::ID2string(_typeId)); 170 171 } 171 172 172 173 void PBMDecoder::decode() { … … 203 204 204 205 void PBMDecoder::readCMAP(Common::IFFChunk &chunk) { 205 206 if (*_colors == NULL) { 206 error( "wrong input chunk sequence");207 error(_t("wrong input chunk sequence")); 207 208 } 208 209 for (uint32 i = 0; i < _colorCount; i++) { 209 210 (*_colors)[i * 3 + 0] = chunk.readByte(); -
graphics/font.cpp
27 27 #include "common/file.h" 28 28 #include "common/endian.h" 29 29 #include "graphics/font.h" 30 #include "common/translation.h" 30 31 31 32 namespace Graphics { 32 33 … … 175 176 goto errout; 176 177 177 178 if (!bdf_read_header(fp, pf)) { 178 warning( "Error reading font header");179 warning(_t("Error reading font header")); 179 180 goto errout; 180 181 } 181 182 182 183 fp.seek(pos, SEEK_SET); 183 184 184 185 if (!bdf_read_bitmaps(fp, pf)) { 185 warning( "Error reading font bitmaps");186 warning(_t("Error reading font bitmaps")); 186 187 goto errout; 187 188 } 188 189 … … 210 211 211 212 for (;;) { 212 213 if (!bdf_getline(fp, buf, sizeof(buf))) { 213 warning( "Error: EOF on file");214 warning(_t("Error: EOF on file")); 214 215 return 0; 215 216 } 216 217 if (isprefix(buf, "FONT ")) { /* not required*/ 217 218 if (sscanf(buf, "FONT %[^\n]", facename) != 1) { 218 warning( "Error: bad 'FONT'");219 warning(_t("Error: bad 'FONT'")); 219 220 return 0; 220 221 } 221 222 pf->facename = strdup(facename); … … 223 224 } 224 225 if (isprefix(buf, "COPYRIGHT ")) { /* not required*/ 225 226 if (sscanf(buf, "COPYRIGHT \"%[^\"]", copyright) != 1) { 226 warning( "Error: bad 'COPYRIGHT'");227 warning(_t("Error: bad 'COPYRIGHT'")); 227 228 return 0; 228 229 } 229 230 pf->copyright = strdup(copyright); … … 231 232 } 232 233 if (isprefix(buf, "DEFAULT_CHAR ")) { /* not required*/ 233 234 if (sscanf(buf, "DEFAULT_CHAR %d", &pf->defaultchar) != 1) { 234 warning( "Error: bad 'DEFAULT_CHAR'");235 warning(_t("Error: bad 'DEFAULT_CHAR'")); 235 236 return 0; 236 237 } 237 238 } 238 239 if (isprefix(buf, "FONT_DESCENT ")) { 239 240 if (sscanf(buf, "FONT_DESCENT %d", &pf->descent) != 1) { 240 warning( "Error: bad 'FONT_DESCENT'");241 warning(_t("Error: bad 'FONT_DESCENT'")); 241 242 return 0; 242 243 } 243 244 continue; 244 245 } 245 246 if (isprefix(buf, "FONT_ASCENT ")) { 246 247 if (sscanf(buf, "FONT_ASCENT %d", &pf->ascent) != 1) { 247 warning( "Error: bad 'FONT_ASCENT'");248 warning(_t("Error: bad 'FONT_ASCENT'")); 248 249 return 0; 249 250 } 250 251 continue; … … 252 253 if (isprefix(buf, "FONTBOUNDINGBOX ")) { 253 254 if (sscanf(buf, "FONTBOUNDINGBOX %d %d %d %d", 254 255 &pf->fbbw, &pf->fbbh, &pf->fbbx, &pf->fbby) != 4) { 255 warning( "Error: bad 'FONTBOUNDINGBOX'");256 warning(_t("Error: bad 'FONTBOUNDINGBOX'")); 256 257 return 0; 257 258 } 258 259 continue; 259 260 } 260 261 if (isprefix(buf, "CHARS ")) { 261 262 if (sscanf(buf, "CHARS %d", &nchars) != 1) { 262 warning( "Error: bad 'CHARS'");263 warning(_t("Error: bad 'CHARS'")); 263 264 return 0; 264 265 } 265 266 continue; … … 272 273 */ 273 274 if (isprefix(buf, "ENCODING ")) { 274 275 if (sscanf(buf, "ENCODING %d", &encoding) != 1) { 275 warning( "Error: bad 'ENCODING'");276 warning(_t("Error: bad 'ENCODING'")); 276 277 return 0; 277 278 } 278 279 if (encoding >= 0 && … … 292 293 293 294 /* calc font height*/ 294 295 if (pf->ascent < 0 || pf->descent < 0 || firstchar < 0) { 295 warning( "Error: Invalid BDF file, requires FONT_ASCENT/FONT_DESCENT/ENCODING");296 warning(_t("Error: Invalid BDF file, requires FONT_ASCENT/FONT_DESCENT/ENCODING")); 296 297 return 0; 297 298 } 298 299 pf->height = pf->ascent + pf->descent; … … 322 323 pf->bbx = (BBX *)malloc(pf->size * sizeof(BBX)); 323 324 324 325 if (!pf->bits || !pf->offset || !pf->width) { 325 warning( "Error: no memory for font load");326 warning(_t("Error: no memory for font load")); 326 327 return 0; 327 328 } 328 329 … … 347 348 348 349 for (;;) { 349 350 if (!bdf_getline(fp, buf, sizeof(buf))) { 350 warning( "Error: EOF on file");351 warning(_t("Error: EOF on file")); 351 352 return 0; 352 353 } 353 354 if (isprefix(buf, "STARTCHAR")) { … … 356 357 } 357 358 if (isprefix(buf, "ENCODING ")) { 358 359 if (sscanf(buf, "ENCODING %d", &encoding) != 1) { 359 warning( "Error: bad 'ENCODING'");360 warning(_t("Error: bad 'ENCODING'")); 360 361 return 0; 361 362 } 362 363 if (encoding < start_char || encoding > limit_char) … … 365 366 } 366 367 if (isprefix(buf, "DWIDTH ")) { 367 368 if (sscanf(buf, "DWIDTH %d", &width) != 1) { 368 warning( "Error: bad 'DWIDTH'");369 warning(_t("Error: bad 'DWIDTH'")); 369 370 return 0; 370 371 } 371 372 /* use font boundingbox width if DWIDTH <= 0*/ … … 375 376 } 376 377 if (isprefix(buf, "BBX ")) { 377 378 if (sscanf(buf, "BBX %d %d %d %d", &bbw, &bbh, &bbx, &bby) != 4) { 378 warning( "Error: bad 'BBX'");379 warning(_t("Error: bad 'BBX'")); 379 380 return 0; 380 381 } 381 382 continue; … … 389 390 390 391 /* set bits offset in encode map*/ 391 392 if (pf->offset[encoding-pf->firstchar] != (unsigned long)-1) { 392 warning( "Error: duplicate encoding for character %d (0x%02x), ignoring duplicate",393 warning(_t("Error: duplicate encoding for character %d (0x%02x), ignoring duplicate"), 393 394 encoding, encoding); 394 395 continue; 395 396 } … … 412 413 /* read bitmaps*/ 413 414 for (i = 0; i < bbh; ++i) { 414 415 if (!bdf_getline(fp, buf, sizeof(buf))) { 415 warning( "Error: EOF reading BITMAP data");416 warning(_t("Error: EOF reading BITMAP data")); 416 417 return 0; 417 418 } 418 419 if (isprefix(buf, "ENDCHAR")) … … 500 501 } 501 502 else { 502 503 if (ofs > pf->bits_size) { 503 warning( "Warning: DWIDTH spec > max FONTBOUNDINGBOX");504 warning(_t("Warning: DWIDTH spec > max FONTBOUNDINGBOX")); 504 505 if (ofs > pf->bits_size+EXTRA) { 505 warning( "Error: Not enough bits initially allocated");506 warning(_t("Error: Not enough bits initially allocated")); 506 507 return 0; 507 508 } 508 509 pf->bits_size = ofs; … … 587 588 bool NewFont::cacheFontData(const NewFont &font, const Common::String &filename) { 588 589 Common::File cacheFile; 589 590 if (!cacheFile.open(filename, Common::File::kFileWriteMode)) { 590 warning( "Couldn't open file '%s' for writing", filename.c_str());591 warning(_t("Couldn't open file '%s' for writing"), filename.c_str()); 591 592 return false; 592 593 } 593 594 -
graphics/dxa_player.cpp
27 27 #include "common/endian.h" 28 28 #include "graphics/dxa_player.h" 29 29 #include "common/util.h" 30 #include "common/translation.h" 30 31 31 32 #ifdef USE_ZLIB 32 33 #include <zlib.h> … … 126 127 _curHeight = _height; 127 128 } 128 129 129 debug(2, "flags 0x0%x framesCount %d width %d height %d rate %d ticks %d", flags, _framesCount, _width, _height, _framesPerSec, _frameTicks);130 debug(2, _t("flags 0x0%x framesCount %d width %d height %d rate %d ticks %d"), flags, _framesCount, _width, _height, _framesPerSec, _frameTicks); 130 131 131 132 _frameSize = _width * _height; 132 133 _frameBuffer1 = (uint8 *)malloc(_frameSize); 133 134 _frameBuffer2 = (uint8 *)malloc(_frameSize); 134 135 if (!_frameBuffer1 || !_frameBuffer2) 135 error( "DXAPlayer: Error allocating frame buffers (size %d)", _frameSize);136 error(_t("DXAPlayer: Error allocating frame buffers (size %d)"), _frameSize); 136 137 137 138 _scaledBuffer = 0; 138 139 if (_scaleMode != S_NONE) { 139 140 _scaledBuffer = (uint8 *)malloc(_frameSize); 140 141 if (!_scaledBuffer) 141 error( "Error allocating scale buffer (size %d)", _frameSize);142 error(_t("Error allocating scale buffer (size %d)"), _frameSize); 142 143 } 143 144 144 145 _frameNum = 0; … … 285 286 case 5: 286 287 break; 287 288 default: 288 error( "decode12: Unknown type %d", type);289 error(_t("decode12: Unknown type %d"), type); 289 290 } 290 291 } 291 292 } … … 470 471 break; 471 472 } 472 473 default: 473 error( "decode13: Unknown type %d", type);474 error(_t("decode13: Unknown type %d"), type); 474 475 } 475 476 } 476 477 } … … 510 511 decode13(_frameBuffer2, size, _frameSize); 511 512 break; 512 513 default: 513 error( "decodeFrame: Unknown compression type %d", type);514 error(_t("decodeFrame: Unknown compression type %d"), type); 514 515 } 515 516 if (type == 2 || type == 4 || type == 12 || type == 13) { 516 517 memcpy(_frameBuffer1, _frameBuffer2, _frameSize); -
graphics/surface.cpp
26 26 #include "common/util.h" 27 27 #include "graphics/primitives.h" 28 28 #include "graphics/surface.h" 29 #include "common/translation.h" 29 30 30 31 namespace Graphics { 31 32 … … 51 52 else if (bytesPerPixel == 2) 52 53 Graphics::drawLine(x0, y0, x1, y1, color, &plotPoint2, this); 53 54 else 54 error( "Surface::drawLine: bytesPerPixel must be 1 or 2");55 error(_t("Surface::drawLine: bytesPerPixel must be 1 or 2")); 55 56 } 56 57 57 58 void Surface::create(uint16 width, uint16 height, uint8 bytesPP) { … … 96 97 *ptr++ = (uint16)color; 97 98 } 98 99 } else { 99 error( "Surface::hLine: bytesPerPixel must be 1 or 2");100 error(_t("Surface::hLine: bytesPerPixel must be 1 or 2")); 100 101 } 101 102 } 102 103 … … 126 127 ptr += pitch/2; 127 128 } 128 129 } else { 129 error( "Surface::vLine: bytesPerPixel must be 1 or 2");130 error(_t("Surface::vLine: bytesPerPixel must be 1 or 2")); 130 131 } 131 132 } 132 133 … … 156 157 ptr += pitch/2; 157 158 } 158 159 } else { 159 error( "Surface::fillRect: bytesPerPixel must be 1 or 2");160 error(_t("Surface::fillRect: bytesPerPixel must be 1 or 2")); 160 161 } 161 162 } 162 163 -
base/main.cpp
41 41 #include "common/file.h" 42 42 #include "common/fs.h" 43 43 #include "common/system.h" 44 #include "common/translation.h" 44 45 #include "gui/newgui.h" 45 46 #include "gui/message.h" 46 47 … … 94 95 ConfMan.set("gameid", gameid); 95 96 96 97 // Query the plugins and find one that will handle the specified gameid 97 printf( "Looking for %s\n", gameid.c_str());98 printf(_t("Looking for %s\n"), gameid.c_str()); 98 99 GameDescriptor game = Base::findGame(gameid, &plugin); 99 100 100 101 if (plugin == 0) { 101 printf( "Failed game detection\n");102 warning( "%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());102 printf(_t("Failed game detection\n")); 103 warning(_t("%s is an invalid gameid. Use the --list-games option to list supported gameid"), gameid.c_str()); 103 104 return 0; 104 105 } 105 106 106 107 // FIXME: Do we really need this one? 107 printf( "Trying to start game '%s'\n", game.description().c_str());108 printf(_t("Trying to start game '%s'\n"), game.description().c_str()); 108 109 109 110 return plugin; 110 111 } … … 132 133 path = ConfMan.get("path"); 133 134 FilesystemNode dir(path); 134 135 if (!dir.isDirectory()) { 135 warning( "Game directory does not exist (%s)", path.c_str());136 warning(_t("Game directory does not exist (%s)"), path.c_str()); 136 137 return 0; 137 138 } 138 139 } else { 139 140 path = "."; 140 warning( "No path was provided. Assuming the data files are in the current directory");141 warning(_t("No path was provided. Assuming the data files are in the current directory")); 141 142 } 142 143 Common::File::addDefaultDirectory(path); 143 144 … … 152 153 const char *errMsg = 0; 153 154 switch (err) { 154 155 case kInvalidPathError: 155 errMsg = "Invalid game path";156 errMsg = _t("Invalid game path"); 156 157 break; 157 158 case kNoGameDataFoundError: 158 errMsg = "Unable to locate game data";159 errMsg = _t("Unable to locate game data"); 159 160 break; 160 161 default: 161 errMsg = "Unknown error";162 errMsg = _t("Unknown error"); 162 163 } 163 164 164 warning( "%s failed to instantiate engine: %s (target '%s', path '%s')",165 warning(_t("%s failed to instantiate engine: %s (target '%s', path '%s')"), 165 166 plugin->getName(), 166 167 errMsg, 167 168 ConfMan.getActiveDomainName().c_str(), … … 264 265 // requested. 265 266 if (settings.contains("debuglevel")) { 266 267 gDebugLevel = (int)strtol(settings["debuglevel"].c_str(), 0, 10); 267 printf( "Debuglevel (from command line): %d\n", gDebugLevel);268 printf(_t("Debuglevel (from command line): %d\n"), gDebugLevel); 268 269 settings.erase("debuglevel"); // This option should not be passed to ConfMan. 269 270 } else if (ConfMan.hasKey("debuglevel")) 270 271 gDebugLevel = ConfMan.getInt("debuglevel"); -
base/commandLine.cpp
32 32 33 33 #include "common/config-manager.h" 34 34 #include "common/system.h" 35 #include "common/translation.h" 35 36 36 37 #include "sound/mididrv.h" 37 38 #include "sound/mixer.h" … … 253 254 // Use this for options which have a required (string) value 254 255 #define DO_OPTION(shortCmd, longCmd) \ 255 256 DO_OPTION_OPT(shortCmd, longCmd, 0) \ 256 if (!option) usage( "Option '%s' requires an argument", argv[isLongCmd ? i : i-1]);257 if (!option) usage(_t("Option '%s' requires an argument"), argv[isLongCmd ? i : i-1]); 257 258 258 259 // Use this for options which have a required integer value 259 260 #define DO_OPTION_INT(shortCmd, longCmd) \ 260 261 DO_OPTION(shortCmd, longCmd) \ 261 262 char *endptr = 0; \ 262 263 int intValue; intValue = (int)strtol(option, &endptr, 0); \ 263 if (endptr == NULL || *endptr != 0) usage( "--%s: Invalid number '%s'", longCmd, option);264 if (endptr == NULL || *endptr != 0) usage(_t("--%s: Invalid number '%s'"), longCmd, option); 264 265 265 266 // Use this for boolean options; this distinguishes between "-x" and "-X", 266 267 // resp. between "--some-option" and "--no-some-option". … … 319 320 // Hence it must be the target name. We currently enforce that 320 321 // this always comes last. 321 322 if (i != argc - 1) 322 usage( "Stray argument '%s'", s);323 usage(_t("Stray argument '%s'"), s); 323 324 324 325 // We defer checking whether this is a valid target to a later point. 325 326 return s; … … 358 359 359 360 DO_OPTION('e', "music-driver") 360 361 if (MidiDriver::parseMusicDriver(option) < 0) 361 usage( "Unrecognized music driver '%s'", option);362 usage(_t("Unrecognized music driver '%s'"), option); 362 363 END_OPTION 363 364 364 365 DO_LONG_OPTION_INT("output-rate") … … 380 381 } 381 382 } 382 383 if (!isValid) 383 usage( "Unrecognized graphics mode '%s'", option);384 usage(_t("Unrecognized graphics mode '%s'"), option); 384 385 END_OPTION 385 386 386 387 DO_OPTION_INT('m', "music-volume") … … 395 396 396 397 DO_OPTION('q', "language") 397 398 if (Common::parseLanguage(option) == Common::UNK_LANG) 398 usage( "Unrecognized language '%s'", option);399 usage(_t("Unrecognized language '%s'"), option); 399 400 END_OPTION 400 401 401 402 DO_OPTION_INT('s', "sfx-volume") … … 424 425 DO_LONG_OPTION("platform") 425 426 int platform = Common::parsePlatform(option); 426 427 if (platform == Common::kPlatformUnknown) 427 usage( "Unrecognized platform '%s'", option);428 usage(_t("Unrecognized platform '%s'"), option); 428 429 END_OPTION 429 430 430 431 DO_LONG_OPTION("soundfont") … … 449 450 DO_LONG_OPTION("render-mode") 450 451 int renderMode = Common::parseRenderMode(option); 451 452 if (renderMode == Common::kRenderDefault) 452 usage( "Unrecognized render mode '%s'", option);453 usage(_t("Unrecognized render mode '%s'"), option); 453 454 END_OPTION 454 455 455 456 DO_LONG_OPTION("savepath") … … 487 488 488 489 unknownOption: 489 490 // If we get till here, the option is unhandled and hence unknown. 490 usage( "Unrecognized option '%s'", argv[i]);491 usage(_t("Unrecognized option '%s'"), argv[i]); 491 492 } 492 493 } 493 494 … … 497 498 498 499 /** List all supported game IDs, i.e. all games which any loaded plugin supports. */ 499 500 static void listGames() { 500 printf( "Game ID Full Title \n"501 "-------------------- ------------------------------------------------------\n") ;501 printf(_t("Game ID Full Title \n" 502 "-------------------- ------------------------------------------------------\n")); 502 503 503 504 const PluginList &plugins = PluginManager::instance().getPlugins(); 504 505 PluginList::const_iterator iter = plugins.begin(); … … 512 513 513 514 /** List all targets which are configured in the config file. */ 514 515 static void listTargets() { 515 printf( "Target Description \n"516 "-------------------- ------------------------------------------------------\n") ;516 printf(_t("Target Description \n" 517 "-------------------- ------------------------------------------------------\n")); 517 518 518 519 using namespace Common; 519 520 const ConfigManager::DomainMap &domains = ConfMan.getGameDomains(); … … 550 551 Common::String name(iter->_key); 551 552 Common::String gameid(iter->_value.get("gameid")); 552 553 Common::String path(iter->_value.get("path")); 553 printf( "Looking at target '%s', gameid '%s', path '%s' ...\n",554 printf(_t("Looking at target '%s', gameid '%s', path '%s' ...\n"), 554 555 name.c_str(), gameid.c_str(), path.c_str()); 555 556 if (path.empty()) { 556 printf( " ... no path specified, skipping\n");557 printf(_t(" ... no path specified, skipping\n")); 557 558 continue; 558 559 } 559 560 if (gameid.empty()) { … … 563 564 FilesystemNode dir(path); 564 565 FSList files; 565 566 if (!dir.listDir(files, FilesystemNode::kListAll)) { 566 printf( " ... invalid path, skipping\n");567 printf(_t(" ... invalid path, skipping\n")); 567 568 continue; 568 569 } 569 570 … … 575 576 } 576 577 577 578 if (candidates.empty()) { 578 printf( " FAILURE: No games detected\n");579 printf(_t(" FAILURE: No games detected\n")); 579 580 failure++; 580 581 } else if (candidates.size() > 1) { 581 582 if (gameidDiffers) { 582 printf( " FAILURE: Multiple games detected, some/all with wrong gameid\n");583 printf(_t(" FAILURE: Multiple games detected, some/all with wrong gameid\n")); 583 584 } else { 584 printf( " FAILURE: Multiple games detected, but all have the same gameid\n");585 printf(_t(" FAILURE: Multiple games detected, but all have the same gameid\n")); 585 586 } 586 587 failure++; 587 588 } else if (gameidDiffers) { 588 printf( " FAILURE: Wrong gameid detected\n");589 printf(_t(" FAILURE: Wrong gameid detected\n")); 589 590 failure++; 590 591 } else { 591 printf( " SUCCESS: Game was detected correctly\n");592 printf(_t(" SUCCESS: Game was detected correctly\n")); 592 593 success++; 593 594 } 594 595 595 596 for (x = candidates.begin(); x != candidates.end(); ++x) { 596 printf( " gameid '%s', desc '%s', language '%s', platform '%s'\n",597 printf(_t(" gameid '%s', desc '%s', language '%s', platform '%s'\n"), 597 598 x->gameid().c_str(), 598 599 x->description().c_str(), 599 600 Common::getLanguageCode(x->language()), … … 601 602 } 602 603 } 603 604 int total = domains.size(); 604 printf( "Detector test run: %d fail, %d success, %d skipped, out of %d\n",605 printf(_t("Detector test run: %d fail, %d success, %d skipped, out of %d\n"), 605 606 failure, success, total - failure - success, total); 606 607 } 607 608 #endif … … 622 623 return false; 623 624 } else if (command == "version") { 624 625 printf("%s\n", gScummVMFullVersion); 625 printf( "Features compiled in: %s\n", gScummVMFeatures);626 printf(_t("Features compiled in: %s\n"), gScummVMFeatures); 626 627 return false; 627 628 } else if (command == "help") { 628 629 printf(HELP_STRING, s_appName); … … 660 661 ConfMan.set("id_came_from_command_line", "1"); 661 662 662 663 } else { 663 usage( "Unrecognized game target '%s'", command.c_str());664 usage(_t("Unrecognized game target '%s'"), command.c_str()); 664 665 } 665 666 } 666 667