diff options
author | Eugene Sandulenko | 2010-06-15 10:44:51 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-06-15 10:44:51 +0000 |
commit | 859212df2523e8b15076d968018dbf98618fd60f (patch) | |
tree | e3f7ff62c58c9ac8a762791c0a1801b75fe1f14a /engines | |
parent | db6673c408865b201808e01ab5db796f2e794058 (diff) | |
download | scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.gz scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.bz2 scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.zip |
Implement translation support for ScummVM GUI.
Based on patch #2903830: "Updated Translation Prototype" by alexbevi
which in turn is based on patch #1739965 by jvprat.
Currently it builds all translations right into ScummVM. Once the
feature will be accepted more widely, i.e. more translations will
pop up, it will be trivial to move translation strings to external
file.
Finished translation: Russian
Unfinished translation: Hungarian
Things which are nice to do:
- Language code -> language mapping for more user friendness
- Specifying fonts to be used with language
- Updating of interface language without restart. It will require
moving of much code to reflowLayout() methods for each dialog
The .po files must be in single byte encodings. I.e. no support
for Unicode.
svn-id: r49759
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dialogs.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 954bc81470..4e4a656cc0 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -28,6 +28,7 @@ #include "common/savefile.h" #include "common/system.h" #include "common/events.h" +#include "common/translation.h" #include "graphics/scaler.h" @@ -85,37 +86,37 @@ MainMenuDialog::MainMenuDialog(Engine *engine) StaticTextWidget *version = new StaticTextWidget(this, "GlobalMenu.Version", gScummVMVersionDate); version->setAlign(Graphics::kTextAlignCenter); - new GUI::ButtonWidget(this, "GlobalMenu.Resume", "Resume", kPlayCmd, 'P'); + new GUI::ButtonWidget(this, "GlobalMenu.Resume", _("Resume"), kPlayCmd, 'P'); - _loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", "Load", kLoadCmd, 'L'); + _loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", _("Load"), kLoadCmd, 'L'); // TODO: setEnabled -> setVisible _loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime)); - _saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", "Save", kSaveCmd, 'S'); + _saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", _("Save"), kSaveCmd, 'S'); // TODO: setEnabled -> setVisible _saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsSavingDuringRuntime)); - new GUI::ButtonWidget(this, "GlobalMenu.Options", "Options", kOptionsCmd, 'O'); + new GUI::ButtonWidget(this, "GlobalMenu.Options", _("Options"), kOptionsCmd, 'O'); // The help button is disabled by default. // To enable "Help", an engine needs to use a subclass of MainMenuDialog // (at least for now, we might change how this works in the future). - _helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", "Help", kHelpCmd, 'H'); + _helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", _("Help"), kHelpCmd, 'H'); _helpButton->setEnabled(false); - new GUI::ButtonWidget(this, "GlobalMenu.About", "About", kAboutCmd, 'A'); + new GUI::ButtonWidget(this, "GlobalMenu.About", _("About"), kAboutCmd, 'A'); - _rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", "Return to Launcher", kRTLCmd, 'R'); + _rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", _("Return to Launcher"), kRTLCmd, 'R'); _rtlButton->setEnabled(_engine->hasFeature(Engine::kSupportsRTL)); - new GUI::ButtonWidget(this, "GlobalMenu.Quit", "Quit", kQuitCmd, 'Q'); + new GUI::ButtonWidget(this, "GlobalMenu.Quit", _("Quit"), kQuitCmd, 'Q'); _aboutDialog = new GUI::AboutDialog(); _optionsDialog = new ConfigDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions)); - _loadDialog = new GUI::SaveLoadChooser("Load game:", "Load"); + _loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load")); _loadDialog->setSaveMode(false); - _saveDialog = new GUI::SaveLoadChooser("Save game:", "Save"); + _saveDialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save")); _saveDialog->setSaveMode(true); } @@ -297,11 +298,11 @@ ConfigDialog::ConfigDialog(bool subtitleControls) // Add the buttons // - new GUI::ButtonWidget(this, "GlobalConfig.Ok", "OK", GUI::kOKCmd, 'O'); - new GUI::ButtonWidget(this, "GlobalConfig.Cancel", "Cancel", GUI::kCloseCmd, 'C'); + new GUI::ButtonWidget(this, "GlobalConfig.Ok", _("OK"), GUI::kOKCmd, 'O'); + new GUI::ButtonWidget(this, "GlobalConfig.Cancel", _("Cancel"), GUI::kCloseCmd, 'C'); #ifdef SMALL_SCREEN_DEVICE - new GUI::ButtonWidget(this, "GlobalConfig.Keys", "Keys", kKeysCmd, 'K'); + new GUI::ButtonWidget(this, "GlobalConfig.Keys", _("Keys"), kKeysCmd, 'K'); _keysDialog = NULL; #endif } |