From 025e970b3d54d5c0c1422506e3d3c671f745fd8a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 6 Feb 2006 20:41:05 +0000 Subject: [PATCH] make hard-coded strings localizable --- stepmania/Themes/default/Languages/en.ini | 9 +++++++++ stepmania/src/RageDisplay_D3D.cpp | 15 ++++++++------- stepmania/src/RageDisplay_OGL.cpp | 7 +++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/stepmania/Themes/default/Languages/en.ini b/stepmania/Themes/default/Languages/en.ini index cad8e20813..f9f9a53908 100644 --- a/stepmania/Themes/default/Languages/en.ini +++ b/stepmania/Themes/default/Languages/en.ini @@ -1519,3 +1519,12 @@ Song=Song Steps=Steps Course=Course Modifier=Modifier + +[RageDisplay_OGL] +Obtain an updated driver from your video card manufacturer.=Obtain an updated driver from your video card manufacturer. +GLDirect was detected. GLDirect is not compatible with this game and should be disabled.=GLDirect was detected. GLDirect is not compatible with this game and should be disabled. + +[RageDisplay_D3D] +DirectX 8.1 or greater is not installed. You can download it from:=DirectX 8.1 or greater is not installed. You can download it from: +Your system is reporting that Direct3D hardware acceleration is not available. Please obtain an updated driver from your video card manufacturer.=Your system is reporting that Direct3D hardware acceleration is not available. Please obtain an updated driver from your video card manufacturer. + diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index eadcdca539..311f74109a 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -14,6 +14,7 @@ #include "RageSurfaceUtils.h" #include "EnumHelper.h" #include "DisplayResolutions.h" +#include "LocalizedString.h" #include #include @@ -203,10 +204,11 @@ RageDisplay_D3D::RageDisplay_D3D() } -#define D3D_NOT_INSTALLED \ - "DirectX 8.1 or greater is not installed. You can download it from:\n" \ - "http://www.microsoft.com/downloads/details.aspx?FamilyID=a19bed22-0b25-4e5d-a584-6389d8a3dad0&displaylang=en" +static LocalizedString D3D_NOT_INSTALLED ( "RageDisplay_D3D", "DirectX 8.1 or greater is not installed. You can download it from:" ); +const RString D3D_URL = "http://www.microsoft.com/downloads/details.aspx?FamilyID=a19bed22-0b25-4e5d-a584-6389d8a3dad0&displaylang=en"; +static LocalizedString HARDWARE_ACCELERATION_NOT_AVAILABLE ( "RageDisplay_D3D", + "Your system is reporting that Direct3D hardware acceleration is not available. Please obtain an updated driver from your video card manufacturer." ); RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) { GraphicsWindow::Initialize( true ); @@ -221,7 +223,7 @@ RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnaccelerate #else g_D3D8_Module = LoadLibrary("D3D8.dll"); if(!g_D3D8_Module) - return D3D_NOT_INSTALLED; + return D3D_NOT_INSTALLED.GetValue() + "\n" + D3D_URL; pDirect3DCreate8 = (Direct3DCreate8_t) GetProcAddress(g_D3D8_Module, "Direct3DCreate8"); if(!pDirect3DCreate8) @@ -239,9 +241,8 @@ RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnaccelerate } if( FAILED( g_pd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &g_DeviceCaps) ) ) - return - "Your system is reporting that Direct3D hardware acceleration is not available. " - "Please obtain an updated driver from your video card manufacturer.\n\n"; + return HARDWARE_ACCELERATION_NOT_AVAILABLE; + D3DADAPTER_IDENTIFIER8 identifier; g_pd3d->GetAdapterIdentifier( D3DADAPTER_DEFAULT, 0, &identifier ); diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 0f1bd2957a..399ac3b8be 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -44,6 +44,7 @@ #include "Foreach.h" #include "ProductInfo.h" #include "DisplayResolutions.h" +#include "LocalizedString.h" #include "arch/LowLevelWindow/LowLevelWindow.h" @@ -387,6 +388,8 @@ void InitScalingScript() GLExt.glVertexAttrib2fARB( ATTRIB_TEXTURE_MATRIX_SCALE, 1, 1 ); } +static LocalizedString OBTAIN_AN_UPDATED_VIDEO_DRIVER ( "RageDisplay_OGL", "Obtain an updated driver from your video card manufacturer." ); +static LocalizedString GLDIRECT_IS_NOT_COMPATIBLE ( "RageDisplay_OGL", "GLDirect was detected. GLDirect is not compatible with this game and should be disabled." ); RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) { g_pWind = MakeLowLevelWindow(); @@ -408,7 +411,7 @@ RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnaccelerate if( g_pWind->IsSoftwareRenderer(sError) ) { if( !bAllowUnacceleratedRenderer ) - return sError + " Please obtain an updated driver from your video card manufacturer.\n\n"; + return sError + " " + OBTAIN_AN_UPDATED_VIDEO_DRIVER.GetValue() + "\n\n"; LOG->Warn( "Low-performance OpenGL renderer: " + sError ); } @@ -418,7 +421,7 @@ RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnaccelerate * too using Direct3D directly. (If we can't, it's a bug that we can work * around--if GLDirect can do it, so can we!) */ if( !strncmp( (const char *) glGetString(GL_RENDERER), "GLDirect", 8 ) ) - return "GLDirect was detected. GLDirect is not compatible with " PRODUCT_NAME ", and should be disabled.\n"; + return GLDIRECT_IS_NOT_COMPATIBLE.GetValue() + "\n"; #endif /* Log this, so if people complain that the radar looks bad on their