Make sure that configuration dialog titles for the plugins are translated and a few other missed strings.

Initialize locale in each of the plugins on windows so that the plugin configuration dialogs are translated and the translators will get off my back.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6847 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-01-14 15:09:30 +00:00
parent 3cba9afe79
commit c99f0d03a4
28 changed files with 2482 additions and 1449 deletions

View file

@ -31,6 +31,7 @@ DSPConfigDialogHLE* m_ConfigFrame = NULL;
#include "Setup.h"
#include "StringUtil.h"
#include "LogManager.h"
#include "IniFile.h"
// Declarations and definitions
@ -64,7 +65,39 @@ DSPState g_dspState;
#ifdef _WIN32
HINSTANCE g_hInstance;
#if defined(HAVE_WX) && HAVE_WX
wxLocale *InitLanguageSupport()
{
wxLocale *m_locale;
unsigned int language = 0;
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
// Load language if possible, fall back to system default otherwise
if(wxLocale::IsAvailable(language))
{
m_locale = new wxLocale(language);
m_locale->AddCatalogLookupPathPrefix(wxT("Languages"));
m_locale->AddCatalog(wxT("dolphin-emu"));
if(!m_locale->IsOk())
{
PanicAlertT("Error loading selected language. Falling back to system default.");
delete m_locale;
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
}
else
{
PanicAlertT("The selected language is not supported by your system. Falling back to system default.");
m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
}
return m_locale;
}
class wxDLLApp : public wxApp
{
bool OnInit()
@ -74,27 +107,23 @@ class wxDLLApp : public wxApp
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
static wxLocale *m_locale;
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
#if defined(HAVE_WX) && HAVE_WX
wxSetInstance((HINSTANCE)hinstDLL);
wxInitialize();
#endif
m_locale = InitLanguageSupport();
}
break;
case DLL_PROCESS_DETACH:
#if defined(HAVE_WX) && HAVE_WX
wxUninitialize();
#endif
delete m_locale;
break;
}
@ -118,7 +147,7 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
#elif defined _DEBUG
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin (Debug)");
#else
sprintf(_PluginInfo->Name, "Dolphin DSP-HLE Plugin");
sprintf(_PluginInfo->Name, _trans("Dolphin DSP-HLE Plugin"));
#endif
}