fix locale support

Originally committed to SVN as r374.
This commit is contained in:
David Lamparter 2006-05-06 14:38:53 +00:00
parent dc71ec961d
commit 2c418c3cd3
2 changed files with 8 additions and 1 deletions

View file

@ -64,10 +64,13 @@ void AegisubLocale::Init(int language) {
if (locale) delete locale; if (locale) delete locale;
curCode = language; curCode = language;
locale = new wxLocale(language); locale = new wxLocale(language);
#ifdef WIN32
locale->AddCatalogLookupPathPrefix(AegisubApp::folderName + _T("locale/")); locale->AddCatalogLookupPathPrefix(AegisubApp::folderName + _T("locale/"));
#endif
locale->AddCatalog(_T("aegisub")); locale->AddCatalog(_T("aegisub"));
locale->AddCatalog(_T("wxstd")); locale->AddCatalog(_T("wxstd"));
setlocale(LC_NUMERIC, "English"); setlocale(LC_NUMERIC, "C");
setlocale(LC_CTYPE, "C");
} }

View file

@ -87,6 +87,7 @@ bool AegisubApp::OnInit() {
Hotkeys.SetFile(folderName + _T("/hotkeys.dat")); Hotkeys.SetFile(folderName + _T("/hotkeys.dat"));
Hotkeys.Load(); Hotkeys.Load();
#ifdef WIN32
// Set locale // Set locale
int lang = Options.AsInt(_T("Locale Code")); int lang = Options.AsInt(_T("Locale Code"));
if (lang == -1) { if (lang == -1) {
@ -95,6 +96,9 @@ bool AegisubApp::OnInit() {
Options.Save(); Options.Save();
} }
locale.Init(lang); locale.Init(lang);
#else
locale.Init(wxLocale::GetSystemLanguage());
#endif
// Load export filters // Load export filters
AssExportFilterChain::PrepareFilters(); AssExportFilterChain::PrepareFilters();