Ticket #9116: translations.patch
File translations.patch, 29.1 KB (added by , 15 years ago) |
---|
-
configure
122 122 _keymapper=no 123 123 # Default platform settings 124 124 _backend=sdl 125 _translation=yes 125 126 _endian=unknown 126 127 _need_memalign=no 127 128 _have_x86=no … … 585 586 --disable-mt32emu don't enable the integrated MT-32 emulator 586 587 --disable-hq-scalers exclude HQ2x and HQ3x scalers 587 588 --disable-scalers exclude scalers 589 --disable-translation don't build support for translated messages 588 590 589 591 Optional Libraries: 590 592 --with-alsa-prefix=DIR Prefix where alsa is installed (optional) … … 661 663 --default-dynamic) _plugins_default=dynamic ;; 662 664 --enable-mt32emu) _mt32emu=yes ;; 663 665 --disable-mt32emu) _mt32emu=no ;; 666 --enable-translation) _translation=yes ;; 667 --disable-translation) _translation=no ;; 664 668 --enable-vkeybd) _vkeybd=yes ;; 665 669 --disable-vkeybd) _vkeybd=no ;; 666 670 --enable-keymapper) _keymapper=yes ;; … … 1896 1900 _def_fluidsynth='#undef USE_FLUIDSYNTH' 1897 1901 fi 1898 1902 echo "$_fluidsynth" 1899 rm -rf $TMPC $TMPO$HOSTEXEEXT $TMPO.dSYM1900 1903 1901 1904 # 1902 1905 # Check for nasm … … 1955 1958 fi 1956 1959 1957 1960 # 1961 # Check whether to build translation support 1962 # 1963 echo_n "Building translation support... " 1964 add_to_config_mk_if_yes $_translation 'ENABLE_TRANSLATION = 1' 1965 add_to_config_h_if_yes $_translation '#define TRANSLATION' 1966 if test "$_translation" = no ; then 1967 echo "no" 1968 else 1969 echo_n "yes (" 1970 1971 cat > $TMPC << EOF 1972 #include <locale.h> 1973 int main(void) { setlocale(LC_ALL, ""); return 0; } 1974 EOF 1975 _detectlang=no 1976 cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes 1977 1978 add_to_config_h_if_yes $_detectlang '#define DETECTLANG' 1979 if test "$_detectlang" = yes ; then 1980 echo_n "with runtime language detection, " 1981 1982 cat > $TMPC << EOF 1983 #include <langinfo.h> 1984 #include <iconv.h> 1985 int main(void) { nl_langinfo(CODESET); iconv_open(0, 0); return 0; } 1986 EOF 1987 _termconv=no 1988 cc_check $LDFLAGS $CXXFLAGS && _termconv=yes 1989 cc_check $LDFLAGS $CXXFLAGS -liconv && LIBS="$LIBS -liconv" && _termconv=yes 1990 1991 add_to_config_h_if_yes $_termconv '#define TERMCONV' 1992 if test "$_termconv" = yes ; then 1993 echo "with terminal conversion)" 1994 else 1995 echo "without terminal conversion)" 1996 fi 1997 else 1998 echo "without runtime language detection)" 1999 fi 2000 fi 2001 rm -rf $TMPC $TMPO$HOSTEXEEXT $TMPO.dSYM 2002 2003 # 1958 2004 # Figure out installation directories 1959 2005 # 1960 2006 test -z "$_bindir" && _bindir="$_prefix/bin" -
gui/options.h
190 190 PopUpWidget *_rendererPopUp; 191 191 StaticTextWidget *_autosavePeriodPopUpDesc; 192 192 PopUpWidget *_autosavePeriodPopUp; 193 StaticTextWidget *_guiLanguagePopUpDesc; 194 PopUpWidget *_guiLanguagePopUp; 193 195 }; 194 196 195 197 } // End of namespace GUI -
gui/themes/scummclassic/classic_layout.stx
406 406 type = 'PopUp' 407 407 /> 408 408 </layout> 409 <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'> 410 <widget name = 'GuiLanguagePopupDesc' 411 type = 'OptionsLabel' 412 /> 413 <widget name = 'GuiLanguagePopup' 414 type = 'PopUp' 415 /> 416 </layout> 409 417 <widget name='KeysButton' 410 418 type='Button' 411 419 /> -
gui/themes/scummmodern/scummmodern_layout.stx
416 416 type = 'PopUp' 417 417 /> 418 418 </layout> 419 <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'> 420 <widget name = 'GuiLanguagePopupDesc' 421 type = 'OptionsLabel' 422 /> 423 <widget name = 'GuiLanguagePopup' 424 type = 'PopUp' 425 /> 426 </layout> 419 427 <widget name='KeysButton' 420 428 type='Button' 421 429 /> -
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 … … 67 68 }; 68 69 #endif 69 70 70 static const char *savePeriodLabels[] = { "Never", "every 5 mins", "every 10 mins", "every 15 mins", "every 30 mins", 0 };71 static const char *savePeriodLabels[] = { _s("Never"), _s("every 5 mins"), _s("every 10 mins"), _s("every 15 mins"), _s("every 30 mins"), 0 }; 71 72 static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 }; 72 static const char *outputRateLabels[] = { "<default>", "22 kHz", "8 kHz", "11kHz", "44 kHz", "48 kHz", 0 };73 static const char *outputRateLabels[] = { _s("<default>"), _s("22 kHz"), _s("8 kHz"), _s("11kHz"), _s("44 kHz"), _s("48 kHz"), 0 }; 73 74 static const int outputRateValues[] = { 0, 22050, 8000, 11025, 44100, 48000, -1 }; 74 75 75 76 … … 85 86 } 86 87 87 88 const char *OptionsDialog::_subModeDesc[] = { 88 "Speech Only",89 "Speech and Subtitles",90 "Subtitles Only"89 _s("Speech Only"), 90 _s("Speech and Subtitles"), 91 _s("Subtitles Only") 91 92 }; 92 93 93 94 const char *OptionsDialog::_lowresSubModeDesc[] = { 94 "Speech Only",95 "Speech & Subs",96 "Subtitles Only"95 _s("Speech Only"), 96 _s("Speech & Subs"), 97 _s("Subtitles Only") 97 98 }; 98 99 99 100 void OptionsDialog::init() { … … 222 223 223 224 String soundFont(ConfMan.get("soundfont", _domain)); 224 225 if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) { 225 _soundFont->setLabel( "None");226 _soundFont->setLabel(_("None")); 226 227 _soundFontClearButton->setEnabled(false); 227 228 } else { 228 229 _soundFont->setLabel(soundFont); … … 267 268 int speed; int sliderMaxValue = _subSpeedSlider->getMaxValue(); 268 269 269 270 _subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain)); 270 _subToggleButton->setLabel(_ subModeDesc[_subMode]);271 _subToggleButton->setLabel(_(_subModeDesc[_subMode])); 271 272 272 273 // Engines that reuse the subtitle speed widget set their own max value. 273 274 // Scale the config value accordingly (see addSubtitleControls) … … 378 379 ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain); 379 380 380 381 String soundFont(_soundFont->getLabel()); 381 if (!soundFont.empty() && (soundFont != "None"))382 if (!soundFont.empty() && (soundFont != _("None"))) 382 383 ConfMan.set("soundfont", soundFont, _domain); 383 384 else 384 385 ConfMan.removeKey("soundfont", _domain); … … 465 466 else 466 467 _subMode = 0; 467 468 468 _subToggleButton->setLabel(g_system->getOverlayWidth() > 320 ? _ subModeDesc[_subMode] : _lowresSubModeDesc[_subMode]);469 _subToggleButton->setLabel(g_system->getOverlayWidth() > 320 ? _(_subModeDesc[_subMode]) : _(_lowresSubModeDesc[_subMode])); 469 470 _subToggleButton->draw(); 470 471 _subSpeedDesc->draw(); 471 472 _subSpeedSlider->draw(); … … 476 477 _subSpeedLabel->draw(); 477 478 break; 478 479 case kClearSoundFontCmd: 479 _soundFont->setLabel( "None");480 _soundFont->setLabel(_("None")); 480 481 _soundFontClearButton->setEnabled(false); 481 482 draw(); 482 483 break; … … 522 523 _soundFontButton->setEnabled(enabled); 523 524 _soundFont->setEnabled(enabled); 524 525 525 if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != "None"))526 if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _("None"))) 526 527 _soundFontClearButton->setEnabled(enabled); 527 528 else 528 529 _soundFontClearButton->setEnabled(false); … … 591 592 const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); 592 593 593 594 // The GFX mode popup 594 _gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", "Graphics mode:");595 _gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", _("Graphics mode:")); 595 596 _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup"); 596 597 597 _gfxPopUp->appendEntry( "<default>");598 _gfxPopUp->appendEntry(_("<default>")); 598 599 _gfxPopUp->appendEntry(""); 599 600 while (gm->name) { 600 _gfxPopUp->appendEntry( gm->description, gm->id);601 _gfxPopUp->appendEntry(_(gm->description), gm->id); 601 602 gm++; 602 603 } 603 604 604 605 // RenderMode popup 605 _renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", "Render mode:");606 _renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", _("Render mode:")); 606 607 _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup"); 607 _renderModePopUp->appendEntry( "<default>", Common::kRenderDefault);608 _renderModePopUp->appendEntry(_("<default>"), Common::kRenderDefault); 608 609 _renderModePopUp->appendEntry(""); 609 610 const Common::RenderModeDescription *rm = Common::g_renderModes; 610 611 for (; rm->code; ++rm) { 611 _renderModePopUp->appendEntry( rm->description, rm->id);612 _renderModePopUp->appendEntry(_(rm->description), rm->id); 612 613 } 613 614 614 615 // Fullscreen checkbox 615 _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", "Fullscreen mode", 0, 0);616 _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode"), 0, 0); 616 617 617 618 // Aspect ratio checkbox 618 _aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", "Aspect ratio correction", 0, 0);619 _aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), 0, 0); 619 620 620 621 _enableGraphicSettings = true; 621 622 } 622 623 623 624 void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) { 624 625 // The MIDI mode popup & a label 625 _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", "Music driver:");626 _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _("Music driver:")); 626 627 _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup"); 627 628 628 629 // Populate it … … 633 634 } 634 635 635 636 // The OPL emulator popup & a label 636 _oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", "AdLib emulator:");637 _oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", _("AdLib emulator:")); 637 638 _oplPopUp = new PopUpWidget(boss, prefix + "auOPLPopup"); 638 639 639 640 // Populate it 640 641 const OPL::Config::EmulatorDescription *ed = OPL::Config::getAvailable(); 641 642 while (ed->name) { 642 _oplPopUp->appendEntry( ed->description, ed->id);643 _oplPopUp->appendEntry(_(ed->description), ed->id); 643 644 ++ed; 644 645 } 645 646 646 647 // Sample rate settings 647 _outputRatePopUpDesc = new StaticTextWidget(boss, prefix + "auSampleRatePopupDesc", "Output rate:");648 _outputRatePopUpDesc = new StaticTextWidget(boss, prefix + "auSampleRatePopupDesc", _("Output rate:")); 648 649 _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup"); 649 650 650 651 for (int i = 0; outputRateLabels[i]; i++) { … … 656 657 657 658 void OptionsDialog::addMIDIControls(GuiObject *boss, const String &prefix) { 658 659 // SoundFont 659 _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", "SoundFont:", kChooseSoundFontCmd, 0);660 _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", "None");660 _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), kChooseSoundFontCmd, 0); 661 _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None")); 661 662 _soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", kClearSoundFontCmd, 0); 662 663 663 664 // Multi midi setting 664 _multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", "Mixed AdLib/MIDI mode", 0, 0);665 _multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", _("Mixed AdLib/MIDI mode"), 0, 0); 665 666 666 667 // Native mt32 setting 667 _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", "True Roland MT-32 (disable GM emulation)", 0, 0);668 _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), 0, 0); 668 669 669 670 // GS Extensions setting 670 _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", "Enable Roland GS Mode", 0, 0);671 _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), 0, 0); 671 672 672 673 // MIDI gain setting (FluidSynth uses this) 673 _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", "MIDI gain:");674 _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:")); 674 675 _midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", kMidiGainChanged); 675 676 _midiGainSlider->setMinValue(0); 676 677 _midiGainSlider->setMaxValue(1000); … … 683 684 // make use of the widgets. The launcher range is 0-255. SCUMM's 0-9 684 685 void OptionsDialog::addSubtitleControls(GuiObject *boss, const String &prefix, int maxSliderVal) { 685 686 686 _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", "Text and Speech:");687 _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:")); 687 688 _subToggleButton = new ButtonWidget(boss, prefix + "subToggleButton", "", kSubtitleToggle, 0); 688 689 689 690 // Subtitle speed 690 _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", "Subtitle speed:");691 _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:")); 691 692 _subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", kSubtitleSpeedChanged); 692 693 _subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%"); 693 694 _subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal); … … 699 700 void OptionsDialog::addVolumeControls(GuiObject *boss, const String &prefix) { 700 701 701 702 // Volume controllers 702 _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", "Music volume:");703 _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:")); 703 704 _musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", kMusicVolumeChanged); 704 705 _musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%"); 705 706 _musicVolumeSlider->setMinValue(0); 706 707 _musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume); 707 708 _musicVolumeLabel->setFlags(WIDGET_CLEARBG); 708 709 709 _muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", "Mute All", kMuteAllChanged, 0);710 _muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute All"), kMuteAllChanged, 0); 710 711 711 712 712 _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");713 _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:")); 713 714 _sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged); 714 715 _sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%"); 715 716 _sfxVolumeSlider->setMinValue(0); 716 717 _sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume); 717 718 _sfxVolumeLabel->setFlags(WIDGET_CLEARBG); 718 719 719 _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , "Speech volume:");720 _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:")); 720 721 _speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", kSpeechVolumeChanged); 721 722 _speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%"); 722 723 _speechVolumeSlider->setMinValue(0); … … 739 740 else if (subtitles && speech_mute) // Subtitles only 740 741 return 2; 741 742 else 742 warning( "Wrong configuration: Both subtitles and speech are off. Assuming subtitles only");743 warning(_t("Wrong configuration: Both subtitles and speech are off. Assuming subtitles only")); 743 744 return 2; 744 745 } 745 746 746 747 void OptionsDialog::reflowLayout() { 747 748 if (_graphicsTabId != -1 && _tabWidget) 748 _tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");749 _tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX")); 749 750 750 751 Dialog::reflowLayout(); 751 752 } … … 768 769 // 769 770 // 2) The audio tab 770 771 // 771 tab->addTab( "Audio");772 tab->addTab(_("Audio")); 772 773 addAudioControls(tab, "GlobalOptions_Audio."); 773 774 addSubtitleControls(tab, "GlobalOptions_Audio."); 774 775 775 tab->addTab( "Volume");776 tab->addTab(_("Volume")); 776 777 addVolumeControls(tab, "GlobalOptions_Volume."); 777 778 778 779 // TODO: cd drive setting … … 780 781 // 781 782 // 3) The MIDI tab 782 783 // 783 tab->addTab( "MIDI");784 tab->addTab(_("MIDI")); 784 785 addMIDIControls(tab, "GlobalOptions_MIDI."); 785 786 786 787 // 787 788 // 4) The miscellaneous tab 788 789 // 789 tab->addTab( "Paths");790 tab->addTab(_("Paths")); 790 791 791 792 #if !( defined(__DC__) || defined(__GP32__) ) 792 793 // These two buttons have to be extra wide, or the text will be 793 794 // truncated in the small version of the GUI. 794 795 795 796 // Save game path 796 new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", "Save Path: ", kChooseSaveDirCmd, 0);797 new ButtonWidget(tab, "GlobalOptions_Paths.SaveButton", _("Save Path: "), kChooseSaveDirCmd, 0); 797 798 _savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar"); 798 799 799 new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", "Theme Path:", kChooseThemeDirCmd, 0);800 _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", "None");800 new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), kChooseThemeDirCmd, 0); 801 _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _("None")); 801 802 802 new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", "Extra Path:", kChooseExtraDirCmd, 0);803 _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", "None");803 new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), kChooseExtraDirCmd, 0); 804 _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _("None")); 804 805 805 806 #ifdef DYNAMIC_MODULES 806 new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", "Plugins Path:", kChoosePluginsDirCmd, 0);807 new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), kChoosePluginsDirCmd, 0); 807 808 _pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", "None"); 808 809 #endif 809 810 #endif 810 811 811 tab->addTab( "Misc");812 tab->addTab(_("Misc")); 812 813 813 new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", "Theme:", kChooseThemeCmd, 0);814 new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), kChooseThemeCmd, 0); 814 815 _curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName()); 815 816 816 817 817 _rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", "GUI Renderer:");818 _rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", _("GUI Renderer:")); 818 819 _rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.RendererPopup"); 819 820 820 821 for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i) 821 822 _rendererPopUp->appendEntry(GUI::ThemeEngine::_rendererModes[i].name, GUI::ThemeEngine::_rendererModes[i].mode); 822 823 823 _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", "Autosave:");824 _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:")); 824 825 _autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopup"); 825 826 826 827 for (int i = 0; savePeriodLabels[i]; i++) { … … 828 829 } 829 830 830 831 #ifdef SMALL_SCREEN_DEVICE 831 new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", "Keys", kChooseKeyMappingCmd, 0);832 new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", _("Keys"), kChooseKeyMappingCmd, 0); 832 833 #endif 833 834 835 #ifdef TRANSLATION 836 _guiLanguagePopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.GuiLanguagePopupDesc", _("Language:")); 837 _guiLanguagePopUp = new PopUpWidget(tab, "GlobalOptions_Misc.GuiLanguagePopup"); 838 #ifdef DETECTLANG 839 _guiLanguagePopUp->appendEntry(_("<default>"), 0); 840 #endif // DETECTLANG 841 _guiLanguagePopUp->appendEntry(_("English"), 1); 842 _guiLanguagePopUp->appendEntry("", 0); 843 Common::List<String> languages = TransMan.getSupportedLanguages(); 844 Common::List<String>::iterator lang = languages.begin(); 845 while (lang != languages.end()) { 846 _guiLanguagePopUp->appendEntry(*lang, 2); 847 lang++; 848 } 849 #endif // TRANSLATION 850 834 851 // TODO: joystick setting 835 852 836 853 … … 839 856 _tabWidget = tab; 840 857 841 858 // Add OK & Cancel buttons 842 new ButtonWidget(this, "GlobalOptions.Cancel", "Cancel", kCloseCmd, 0);843 new ButtonWidget(this, "GlobalOptions.Ok", "OK", kOKCmd, 0);859 new ButtonWidget(this, "GlobalOptions.Cancel", _("Cancel"), kCloseCmd, 0); 860 new ButtonWidget(this, "GlobalOptions.Ok", _("OK"), kOKCmd, 0); 844 861 845 862 #ifdef SMALL_SCREEN_DEVICE 846 863 _keysDialog = new KeysDialog(); … … 863 880 Common::String extraPath(ConfMan.get("extrapath", _domain)); 864 881 865 882 if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { 866 _savePath->setLabel( "None");883 _savePath->setLabel(_("None")); 867 884 } else { 868 885 _savePath->setLabel(savePath); 869 886 } 870 887 871 888 if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) { 872 _themePath->setLabel( "None");889 _themePath->setLabel(_("None")); 873 890 } else { 874 891 _themePath->setLabel(themePath); 875 892 } 876 893 877 894 if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { 878 _extraPath->setLabel( "None");895 _extraPath->setLabel(_("None")); 879 896 } else { 880 897 _extraPath->setLabel(extraPath); 881 898 } … … 883 900 #ifdef DYNAMIC_MODULES 884 901 Common::String pluginsPath(ConfMan.get("pluginspath", _domain)); 885 902 if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) { 886 _pluginsPath->setLabel( "None");903 _pluginsPath->setLabel(_("None")); 887 904 } else { 888 905 _pluginsPath->setLabel(pluginsPath); 889 906 } … … 907 924 void GlobalOptionsDialog::close() { 908 925 if (getResult()) { 909 926 String savePath(_savePath->getLabel()); 910 if (!savePath.empty() && (savePath != "None"))927 if (!savePath.empty() && (savePath != _("None"))) 911 928 ConfMan.set("savepath", savePath, _domain); 912 929 913 930 String themePath(_themePath->getLabel()); 914 if (!themePath.empty() && (themePath != "None"))931 if (!themePath.empty() && (themePath != _("None"))) 915 932 ConfMan.set("themepath", themePath, _domain); 916 933 else 917 934 ConfMan.removeKey("themepath", _domain); 918 935 919 936 String extraPath(_extraPath->getLabel()); 920 if (!extraPath.empty() && (extraPath != "None"))937 if (!extraPath.empty() && (extraPath != _("None"))) 921 938 ConfMan.set("extrapath", extraPath, _domain); 922 939 else 923 940 ConfMan.removeKey("extrapath", _domain); 924 941 925 942 #ifdef DYNAMIC_MODULES 926 943 String pluginsPath(_pluginsPath->getLabel()); 927 if (!pluginsPath.empty() && (pluginsPath != "None"))944 if (!pluginsPath.empty() && (pluginsPath != _("None"))) 928 945 ConfMan.set("pluginspath", pluginsPath, _domain); 929 946 else 930 947 ConfMan.removeKey("pluginspath", _domain); … … 940 957 g_gui.loadNewTheme(g_gui.theme()->getThemeId(), selected); 941 958 ConfMan.set("gui_renderer", cfg, _domain); 942 959 } 960 #ifdef TRANSLATION 961 String oldLang = ConfMan.get("gui_language"); 962 switch (_guiLanguagePopUp->getSelectedTag()) { 963 case 0: 964 #ifdef DETECTLANG 965 // Default 966 ConfMan.set("gui_language", "", _domain); 967 break; 968 #endif // DETECTLANG 969 case 1: 970 // English 971 ConfMan.set("gui_language", "C", _domain); 972 break; 973 case 2: 974 // Other language 975 ConfMan.set("gui_language", _guiLanguagePopUp->getSelectedString(), _domain); 976 break; 977 } 978 String newLang = ConfMan.get("gui_language").c_str(); 979 if (newLang != oldLang) { 980 /* 981 // Activate the selected language 982 TransMan.setLanguage(newLang.c_str()); 983 984 // Update widgets' strings 985 g_gui.updateTranslation(); // TODO: Currently you have to restart. 986 */ 987 } 988 #endif // TRANSLATION 943 989 } 944 990 OptionsDialog::close(); 945 991 } … … 947 993 void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { 948 994 switch (cmd) { 949 995 case kChooseSaveDirCmd: { 950 BrowserDialog browser( "Select directory for savegames", true);996 BrowserDialog browser(_("Select directory for savegames"), true); 951 997 if (browser.runModal() > 0) { 952 998 // User made his choice... 953 999 Common::FSNode dir(browser.getResult()); 954 1000 if (dir.isWritable()) { 955 1001 _savePath->setLabel(dir.getPath()); 956 1002 } else { 957 MessageDialog error( "The chosen directory cannot be written to. Please select another one.");1003 MessageDialog error(_("The chosen directory cannot be written to. Please select another one.")); 958 1004 error.runModal(); 959 1005 return; 960 1006 } … … 963 1009 break; 964 1010 } 965 1011 case kChooseThemeDirCmd: { 966 BrowserDialog browser( "Select directory for GUI themes", true);1012 BrowserDialog browser(_("Select directory for GUI themes"), true); 967 1013 if (browser.runModal() > 0) { 968 1014 // User made his choice... 969 1015 Common::FSNode dir(browser.getResult()); … … 973 1019 break; 974 1020 } 975 1021 case kChooseExtraDirCmd: { 976 BrowserDialog browser( "Select directory for extra files", true);1022 BrowserDialog browser(_("Select directory for extra files"), true); 977 1023 if (browser.runModal() > 0) { 978 1024 // User made his choice... 979 1025 Common::FSNode dir(browser.getResult()); … … 984 1030 } 985 1031 #ifdef DYNAMIC_MODULES 986 1032 case kChoosePluginsDirCmd: { 987 BrowserDialog browser( "Select directory for plugins", true);1033 BrowserDialog browser(_("Select directory for plugins"), true); 988 1034 if (browser.runModal() > 0) { 989 1035 // User made his choice... 990 1036 Common::FSNode dir(browser.getResult()); … … 995 1041 } 996 1042 #endif 997 1043 case kChooseSoundFontCmd: { 998 BrowserDialog browser( "Select SoundFont", false);1044 BrowserDialog browser(_("Select SoundFont"), false); 999 1045 if (browser.runModal() > 0) { 1000 1046 // User made his choice... 1001 1047 Common::FSNode file(browser.getResult()); 1002 1048 _soundFont->setLabel(file.getPath()); 1003 1049 1004 if (!file.getPath().empty() && (file.getPath() != "None"))1050 if (!file.getPath().empty() && (file.getPath() != _("None"))) 1005 1051 _soundFontClearButton->setEnabled(true); 1006 1052 else 1007 1053 _soundFontClearButton->setEnabled(false); -
gui/GuiManager.cpp
27 27 #include "common/util.h" 28 28 #include "common/config-manager.h" 29 29 #include "common/algorithm.h" 30 #include "common/translation.h" 30 31 31 32 #include "backends/keymapper/keymapper.h" 32 33 … … 69 70 // Loading the theme failed, try to load the built-in theme 70 71 if (!loadNewTheme("builtin", gfxMode)) { 71 72 // Loading the built-in theme failed as well. Bail out 72 error( "Failed to load any GUI theme, aborting");73 error(_t("Failed to load any GUI theme, aborting")); 73 74 } 74 75 } 75 76 } -
common/module.mk
15 15 stream.o \ 16 16 util.o \ 17 17 system.o \ 18 translation.o \ 18 19 unarj.o \ 19 20 unzip.o \ 20 21 xmlparser.o \ 21 22 zlib.o 22 23 24 ifdef ENABLE_TRANSLATION 25 common/translation.cpp: common/messages.cpp 26 27 common/messages.cpp: $(wildcard po/*.po) 28 tools/po2c $^ > common/messages.cpp 29 endif 30 23 31 # Include common rules 24 32 include $(srcdir)/rules.mk -
Makefile.common
28 28 sound \ 29 29 backends \ 30 30 common \ 31 po 31 32 32 33 ifdef USE_MT32EMU 33 34 MODULES += sound/softsynth/mt32 -
base/main.cpp
44 44 #include "common/file.h" 45 45 #include "common/fs.h" 46 46 #include "common/system.h" 47 #include "common/translation.h" 47 48 #include "gui/GuiManager.h" 48 49 #include "gui/message.h" 49 50 … … 94 95 ConfMan.set("gameid", gameid); 95 96 96 97 // Query the plugins and find one that will handle the specified gameid 97 printf( "User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());98 printf( " Looking for a plugin supporting this gameid... ");98 printf(_t("User picked target '%s' (gameid '%s')...\n"), ConfMan.getActiveDomainName().c_str(), gameid.c_str()); 99 printf(_t(" Looking for a plugin supporting this gameid... ")); 99 100 GameDescriptor game = EngineMan.findGame(gameid, &plugin); 100 101 101 102 if (plugin == 0) { 102 printf( "failed\n");103 warning( "%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());103 printf(_t("failed\n")); 104 warning(_t("%s is an invalid gameid. Use the --list-games option to list supported gameid"), gameid.c_str()); 104 105 return 0; 105 106 } else { 106 107 printf("%s\n", plugin->getName()); 107 108 } 108 109 109 110 // FIXME: Do we really need this one? 110 printf( " Starting '%s'\n", game.description().c_str());111 printf(_t(" Starting '%s'\n"), game.description().c_str()); 111 112 112 113 return plugin; 113 114 } … … 136 137 const char *errMsg = 0; 137 138 switch (err) { 138 139 case Common::kInvalidPathError: 139 errMsg = "Invalid game path";140 errMsg = _t("Invalid game path"); 140 141 break; 141 142 case Common::kNoGameDataFoundError: 142 errMsg = "Unable to locate game data";143 errMsg = _t("Unable to locate game data"); 143 144 break; 144 145 default: 145 errMsg = "Unknown error";146 errMsg = _t("Unknown error"); 146 147 } 147 148 148 warning( "%s failed to instantiate engine: %s (target '%s', path '%s')",149 warning(_t("%s failed to instantiate engine: %s (target '%s', path '%s')"), 149 150 plugin->getName(), 150 151 errMsg, 151 152 ConfMan.getActiveDomainName().c_str(), … … 321 322 // Update the config file 322 323 ConfMan.set("versioninfo", gScummVMVersion, Common::ConfigManager::kApplicationDomain); 323 324 325 // Enable translation 326 TransMan.setLanguage(ConfMan.get("gui_language").c_str()); 324 327 325 328 // Load and setup the debuglevel and the debug flags. We do this at the 326 329 // soonest possible moment to ensure debug output starts early on, if