From 91c11fbf09705f474ef2438c5da3698c9291a0ed Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Apr 2007 04:34:56 +0000 Subject: [PATCH] get locale stuff more correct Originally committed to SVN as r983. --- aegisub/frame_main.cpp | 13 ++++++++++++- aegisub/main.cpp | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/aegisub/frame_main.cpp b/aegisub/frame_main.cpp index 21e33db58..d0f480e3b 100644 --- a/aegisub/frame_main.cpp +++ b/aegisub/frame_main.cpp @@ -77,6 +77,17 @@ FrameMain::FrameMain (wxArrayString args) : wxFrame ((wxFrame*)NULL,-1,_T(""),wxDefaultPosition,wxSize(800,600),wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN) { +#ifdef __WXGTK__ +/* XXX HACK XXX + * Gtk just got initialized. And if we're using the SCIM IME, + * it just did a setlocale(LC_ALL, ""). so, BOOM. "§!$)(!"§$. + */ + setlocale(LC_ALL, ""); + setlocale(LC_CTYPE, "C"); + setlocale(LC_NUMERIC, "C"); +/* XXX HACK XXX */ +#endif + // Set application's frame AegisubApp::Get()->frame = this; @@ -1361,4 +1372,4 @@ bool FrameMain::LoadList(wxArrayString list) { void FrameMain::SetUndoRedoDesc() { editMenu->SetHelpString(0,_T("Undo ")+AssFile::GetUndoDescription()); editMenu->SetHelpString(1,_T("Redo ")+AssFile::GetRedoDescription()); -} \ No newline at end of file +} diff --git a/aegisub/main.cpp b/aegisub/main.cpp index 8e87ec04e..ebbc16587 100644 --- a/aegisub/main.cpp +++ b/aegisub/main.cpp @@ -73,6 +73,10 @@ bool AegisubApp::OnInit() { // Initialize randomizer srand(time(NULL)); + // locale for loading options + setlocale(LC_NUMERIC, "C"); + setlocale(LC_CTYPE, "C"); + // App name SetAppName(_T("Aegisub")); #ifndef _DEBUG @@ -100,7 +104,7 @@ bool AegisubApp::OnInit() { } locale.Init(lang); #else - locale.Init(wxLocale::GetSystemLanguage()); + locale.Init(wxLANGUAGE_DEFAULT); #endif // Load Automation scripts