I18N: Make some OSD messages translatable

This commit is contained in:
Thierry Crozat 2011-06-06 20:08:28 +01:00
parent 226990bb58
commit 014145f240
6 changed files with 55 additions and 36 deletions

View File

@ -30,6 +30,8 @@
#include "backends/platform/sdl/sdl.h"
#include "common/translation.h"
// FIXME move joystick defines out and replace with confile file options
// we should really allow users to map any key to a joystick button using the keymapper.
#define JOY_DEADZONE 2200
@ -268,11 +270,11 @@ bool GP2XSdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event
if (BUTTON_STATE_L == true) {
GPH::ToggleTapMode();
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Left Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Right Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click"));
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Hover (No Click)");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)"));
}
} else {
event.kbd.keycode = Common::KEYCODE_SPACE;
@ -292,18 +294,18 @@ bool GP2XSdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event
case BUTTON_VOLUP:
GP2X_HW::mixerMoveVolume(2);
if (GP2X_HW::volumeLevel == 100) {
g_system->displayMessageOnOSD("Maximum Volume");
g_system->displayMessageOnOSD(_("Maximum Volume"));
} else {
g_system->displayMessageOnOSD("Increasing Volume");
g_system->displayMessageOnOSD(_("Increasing Volume"));
}
break;
case BUTTON_VOLDOWN:
GP2X_HW::mixerMoveVolume(1);
if (GP2X_HW::volumeLevel == 0) {
g_system->displayMessageOnOSD("Minimal Volume");
g_system->displayMessageOnOSD(_("Minimal Volume"));
} else {
g_system->displayMessageOnOSD("Decreasing Volume");
g_system->displayMessageOnOSD(_("Decreasing Volume"));
}
break;
case BUTTON_HOLD:
@ -312,11 +314,11 @@ bool GP2XSdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event
case BUTTON_HELP2:
GPH::ToggleTapMode();
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Right Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click"));
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Hover (No Click)");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)"));
}
break;
}

View File

@ -34,6 +34,7 @@
#include "common/util.h"
#include "common/events.h"
#include "common/translation.h"
#define JOY_DEADZONE 2200
@ -363,11 +364,11 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
if (BUTTON_STATE_L == true) {
GPH::ToggleTapMode();
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Left Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Right Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click"));
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Hover (No Click)");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)"));
}
} else {
event.kbd.keycode = Common::KEYCODE_SPACE;
@ -387,17 +388,17 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
case BUTTON_VOLUP:
WIZ_HW::mixerMoveVolume(2);
if (WIZ_HW::volumeLevel == 100) {
g_system->displayMessageOnOSD("Maximum Volume");
g_system->displayMessageOnOSD(_("Maximum Volume"));
} else {
g_system->displayMessageOnOSD("Increasing Volume");
g_system->displayMessageOnOSD(_("Increasing Volume"));
}
break;
case BUTTON_VOLDOWN:
WIZ_HW::mixerMoveVolume(1);
if (WIZ_HW::volumeLevel == 0) {
g_system->displayMessageOnOSD("Minimal Volume");
g_system->displayMessageOnOSD(_("Minimal Volume"));
} else {
g_system->displayMessageOnOSD("Decreasing Volume");
g_system->displayMessageOnOSD(_("Decreasing Volume"));
}
break;
case BUTTON_HOLD:
@ -406,11 +407,11 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
case BUTTON_HELP2:
GPH::ToggleTapMode();
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Right Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click"));
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Hover (No Click)");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)"));
}
break;
}

View File

@ -34,6 +34,8 @@
#include "backends/platform/openpandora/op-sdl.h"
#include "backends/platform/openpandora/op-options.h"
#include "common/translation.h"
/* Quick default button states for modifiers. */
int BUTTON_STATE_L = false;
@ -73,11 +75,11 @@ bool OPEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
case SDLK_PAGEUP:
OP::ToggleTapMode();
if (OP::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Left Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
} else if (OP::tapmodeLevel == TAPMODE_RIGHT) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Right Click");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click"));
} else if (OP::tapmodeLevel == TAPMODE_HOVER) {
g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Hover (No Click)");
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)"));
}
break;
case SDLK_RSHIFT:

View File

@ -28,6 +28,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/textconsole.h"
#include "common/translation.h"
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
:
@ -394,7 +395,8 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
const int scaleFactor = getScale();
char buffer[128];
sprintf(buffer, "Current display mode: %s\n%d x %d -> %d x %d",
sprintf(buffer, "%s: %s\n%d x %d -> %d x %d",
_("Current display mode"),
newModeName,
_videoMode.screenWidth * scaleFactor,
_videoMode.screenHeight * scaleFactor,
@ -406,7 +408,8 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
char buffer[128];
const int scaleFactor = getScale();
sprintf(buffer, "Current scale: x%d\n%d x %d -> %d x %d",
sprintf(buffer, "%s: x%d\n%d x %d -> %d x %d",
_("Current scale"),
scaleFactor,
_videoMode.screenWidth, _videoMode.screenHeight,
_videoMode.overlayWidth, _videoMode.overlayHeight
@ -449,11 +452,13 @@ void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) {
#ifdef USE_OSD
char buffer[128];
if (getFullscreenMode())
sprintf(buffer, "Fullscreen mode\n%d x %d",
sprintf(buffer, "%s\n%d x %d",
_("Fullscreen mode"),
_hwscreen->w, _hwscreen->h
);
else
sprintf(buffer, "Windowed mode\n%d x %d",
sprintf(buffer, "%s\n%d x %d",
_("Windowed mode"),
_hwscreen->w, _hwscreen->h
);
displayMessageOnOSD(buffer);
@ -508,11 +513,13 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
#ifdef USE_OSD
char buffer[128];
if (getFeatureState(OSystem::kFeatureAspectRatioCorrection))
sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d",
sprintf(buffer, "%s\n%d x %d -> %d x %d",
_("Enabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
else
sprintf(buffer, "Disabled aspect ratio correction\n%d x %d -> %d x %d",
sprintf(buffer, "%s\n%d x %d -> %d x %d",
_("Disabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
displayMessageOnOSD(buffer);
@ -532,9 +539,9 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// modes we use, we might want to consider a better way of
// displaying information to the user.
if (getAntialiasingState())
displayMessageOnOSD("Active filter mode: Linear");
displayMessageOnOSD(_("Active filter mode: Linear"));
else
displayMessageOnOSD("Active filter mode: Nearest");
displayMessageOnOSD(_("Active filter mode: Nearest"));
#endif
return true;
}

View File

@ -2133,12 +2133,14 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
#ifdef USE_OSD
char buffer[128];
if (_videoMode.aspectRatioCorrection)
sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d",
sprintf(buffer, "%s\n%d x %d -> %d x %d",
_("Enabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h
);
else
sprintf(buffer, "Disabled aspect ratio correction\n%d x %d -> %d x %d",
sprintf(buffer, "%s\n%d x %d -> %d x %d",
_("Disabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h
);
@ -2192,7 +2194,8 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
}
if (newScalerName) {
char buffer[128];
sprintf(buffer, "Active graphics filter: %s\n%d x %d -> %d x %d",
sprintf(buffer, "%s %s\n%d x %d -> %d x %d",
_("Active graphics filter:"),
newScalerName,
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h
@ -2246,9 +2249,9 @@ void SdlGraphicsManager::toggleFullScreen() {
endGFXTransaction();
#ifdef USE_OSD
if (_videoMode.fullscreen)
displayMessageOnOSD("Fullscreen mode");
displayMessageOnOSD(_("Fullscreen mode"));
else
displayMessageOnOSD("Windowed mode");
displayMessageOnOSD(_("Windowed mode"));
#endif
}

View File

@ -49,6 +49,7 @@ backends/platform/ds/arm9/source/dsoptions.cpp
backends/platform/iphone/osys_events.cpp
backends/graphics/sdl/sdl-graphics.cpp
backends/graphics/opengl/opengl-graphics.cpp
backends/graphics/openglsdl/openglsdl-graphics.cpp
backends/platform/symbian/src/SymbianActions.cpp
backends/platform/symbian/src/SymbianOS.cpp
backends/events/symbiansdl/symbiansdl-events.cpp
@ -57,3 +58,6 @@ backends/platform/wince/CEActionsPocket.cpp
backends/platform/wince/CEActionsSmartphone.cpp
backends/platform/wince/CELauncherDialog.cpp
backends/platform/wince/wince-sdl.cpp
backends/events/gp2xsdl/gp2xsdl-events.cpp
backends/events/gph/gph-events.cpp
backends/events/openpandora/op-events.cpp