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

View File

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

View File

@ -34,6 +34,8 @@
#include "backends/platform/openpandora/op-sdl.h" #include "backends/platform/openpandora/op-sdl.h"
#include "backends/platform/openpandora/op-options.h" #include "backends/platform/openpandora/op-options.h"
#include "common/translation.h"
/* Quick default button states for modifiers. */ /* Quick default button states for modifiers. */
int BUTTON_STATE_L = false; int BUTTON_STATE_L = false;
@ -73,11 +75,11 @@ bool OPEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
case SDLK_PAGEUP: case SDLK_PAGEUP:
OP::ToggleTapMode(); OP::ToggleTapMode();
if (OP::tapmodeLevel == TAPMODE_LEFT) { 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) { } 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) { } 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; break;
case SDLK_RSHIFT: case SDLK_RSHIFT:

View File

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

View File

@ -2133,12 +2133,14 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
#ifdef USE_OSD #ifdef USE_OSD
char buffer[128]; char buffer[128];
if (_videoMode.aspectRatioCorrection) 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, _videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h _hwscreen->w, _hwscreen->h
); );
else 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, _videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h _hwscreen->w, _hwscreen->h
); );
@ -2192,7 +2194,8 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
} }
if (newScalerName) { if (newScalerName) {
char buffer[128]; 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, newScalerName,
_videoMode.screenWidth, _videoMode.screenHeight, _videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h _hwscreen->w, _hwscreen->h
@ -2246,9 +2249,9 @@ void SdlGraphicsManager::toggleFullScreen() {
endGFXTransaction(); endGFXTransaction();
#ifdef USE_OSD #ifdef USE_OSD
if (_videoMode.fullscreen) if (_videoMode.fullscreen)
displayMessageOnOSD("Fullscreen mode"); displayMessageOnOSD(_("Fullscreen mode"));
else else
displayMessageOnOSD("Windowed mode"); displayMessageOnOSD(_("Windowed mode"));
#endif #endif
} }

View File

@ -49,6 +49,7 @@ backends/platform/ds/arm9/source/dsoptions.cpp
backends/platform/iphone/osys_events.cpp backends/platform/iphone/osys_events.cpp
backends/graphics/sdl/sdl-graphics.cpp backends/graphics/sdl/sdl-graphics.cpp
backends/graphics/opengl/opengl-graphics.cpp backends/graphics/opengl/opengl-graphics.cpp
backends/graphics/openglsdl/openglsdl-graphics.cpp
backends/platform/symbian/src/SymbianActions.cpp backends/platform/symbian/src/SymbianActions.cpp
backends/platform/symbian/src/SymbianOS.cpp backends/platform/symbian/src/SymbianOS.cpp
backends/events/symbiansdl/symbiansdl-events.cpp backends/events/symbiansdl/symbiansdl-events.cpp
@ -57,3 +58,6 @@ backends/platform/wince/CEActionsPocket.cpp
backends/platform/wince/CEActionsSmartphone.cpp backends/platform/wince/CEActionsSmartphone.cpp
backends/platform/wince/CELauncherDialog.cpp backends/platform/wince/CELauncherDialog.cpp
backends/platform/wince/wince-sdl.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