aboutsummaryrefslogtreecommitdiff
path: root/gui/KeysDialog.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:44:51 +0000
committerEugene Sandulenko2010-06-15 10:44:51 +0000
commit859212df2523e8b15076d968018dbf98618fd60f (patch)
treee3f7ff62c58c9ac8a762791c0a1801b75fe1f14a /gui/KeysDialog.cpp
parentdb6673c408865b201808e01ab5db796f2e794058 (diff)
downloadscummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.gz
scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.tar.bz2
scummvm-rg350-859212df2523e8b15076d968018dbf98618fd60f.zip
Implement translation support for ScummVM GUI.
Based on patch #2903830: "Updated Translation Prototype" by alexbevi which in turn is based on patch #1739965 by jvprat. Currently it builds all translations right into ScummVM. Once the feature will be accepted more widely, i.e. more translations will pop up, it will be trivial to move translation strings to external file. Finished translation: Russian Unfinished translation: Hungarian Things which are nice to do: - Language code -> language mapping for more user friendness - Specifying fonts to be used with language - Updating of interface language without restart. It will require moving of much code to reflowLayout() methods for each dialog The .po files must be in single byte encodings. I.e. no support for Unicode. svn-id: r49759
Diffstat (limited to 'gui/KeysDialog.cpp')
-rw-r--r--gui/KeysDialog.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp
index b80dd200bb..65b14f9078 100644
--- a/gui/KeysDialog.cpp
+++ b/gui/KeysDialog.cpp
@@ -40,15 +40,15 @@ enum {
KeysDialog::KeysDialog(const Common::String &title)
: GUI::Dialog("KeysDialog") {
- new ButtonWidget(this, "KeysDialog.Map", "Map", kMapCmd, 0);
- new ButtonWidget(this, "KeysDialog.Ok", "OK", kOKCmd, 0);
- new ButtonWidget(this, "KeysDialog.Cancel", "Cancel", kCloseCmd, 0);
+ new ButtonWidget(this, "KeysDialog.Map", _("Map"), kMapCmd, 0);
+ new ButtonWidget(this, "KeysDialog.Ok", _("OK"), kOKCmd, 0);
+ new ButtonWidget(this, "KeysDialog.Cancel", _("Cancel"), kCloseCmd, 0);
_actionsList = new ListWidget(this, "KeysDialog.List");
_actionsList->setNumberingMode(kListNumberingZero);
_actionTitle = new StaticTextWidget(this, "KeysDialog.Action", title);
- _keyMapping = new StaticTextWidget(this, "KeysDialog.Mapping", "Select an action and click 'Map'");
+ _keyMapping = new StaticTextWidget(this, "KeysDialog.Mapping", _("Select an action and click 'Map'"));
_actionTitle->setFlags(WIDGET_CLEARBG);
_keyMapping->setFlags(WIDGET_CLEARBG);
@@ -79,9 +79,9 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
key = key - Common::ASCII_F1 + SDLK_F1;
#endif
if (key != 0)
- sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+ sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
else
- sprintf(selection, "Associated key : none");
+ sprintf(selection, _("Associated key : none"));
_keyMapping->setLabel(selection);
_keyMapping->draw();
@@ -89,7 +89,7 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
break;
case kMapCmd:
if (_actionsList->getSelected() < 0) {
- _actionTitle->setLabel("Please select an action");
+ _actionTitle->setLabel(_("Please select an action"));
} else {
char selection[100];
@@ -101,11 +101,11 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
key = key - Common::ASCII_F1 + SDLK_F1;
#endif
if (key != 0)
- sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+ sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
else
- sprintf(selection, "Associated key : none");
+ sprintf(selection, _("Associated key : none"));
- _actionTitle->setLabel("Press the key to associate");
+ _actionTitle->setLabel(_("Press the key to associate"));
_keyMapping->setLabel(selection);
_keyMapping->draw();
Actions::Instance()->beginMapping(true);
@@ -140,11 +140,11 @@ void KeysDialog::handleKeyUp(Common::KeyState state) {
Actions::Instance()->setMapping((ActionType)_actionSelected, state.ascii);
if (state.ascii != 0)
- sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey) state.keycode));
+ sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode));
else
- sprintf(selection, "Associated key : none");
+ sprintf(selection, _("Associated key : none"));
- _actionTitle->setLabel("Choose an action to map");
+ _actionTitle->setLabel(_("Choose an action to map"));
_keyMapping->setLabel(selection);
_keyMapping->draw();
_actionTitle->draw();