get locale stuff more correct

Originally committed to SVN as r983.
This commit is contained in:
David Lamparter 2007-04-03 04:34:56 +00:00
parent 246be56350
commit 91c11fbf09
2 changed files with 17 additions and 2 deletions

View file

@ -77,6 +77,17 @@
FrameMain::FrameMain (wxArrayString args) FrameMain::FrameMain (wxArrayString args)
: wxFrame ((wxFrame*)NULL,-1,_T(""),wxDefaultPosition,wxSize(800,600),wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN) : 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 // Set application's frame
AegisubApp::Get()->frame = this; AegisubApp::Get()->frame = this;
@ -1361,4 +1372,4 @@ bool FrameMain::LoadList(wxArrayString list) {
void FrameMain::SetUndoRedoDesc() { void FrameMain::SetUndoRedoDesc() {
editMenu->SetHelpString(0,_T("Undo ")+AssFile::GetUndoDescription()); editMenu->SetHelpString(0,_T("Undo ")+AssFile::GetUndoDescription());
editMenu->SetHelpString(1,_T("Redo ")+AssFile::GetRedoDescription()); editMenu->SetHelpString(1,_T("Redo ")+AssFile::GetRedoDescription());
} }

View file

@ -73,6 +73,10 @@ bool AegisubApp::OnInit() {
// Initialize randomizer // Initialize randomizer
srand(time(NULL)); srand(time(NULL));
// locale for loading options
setlocale(LC_NUMERIC, "C");
setlocale(LC_CTYPE, "C");
// App name // App name
SetAppName(_T("Aegisub")); SetAppName(_T("Aegisub"));
#ifndef _DEBUG #ifndef _DEBUG
@ -100,7 +104,7 @@ bool AegisubApp::OnInit() {
} }
locale.Init(lang); locale.Init(lang);
#else #else
locale.Init(wxLocale::GetSystemLanguage()); locale.Init(wxLANGUAGE_DEFAULT);
#endif #endif
// Load Automation scripts // Load Automation scripts