Look for language.txt for locale, from Zap.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1427 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2004-12-04 19:04:57 +00:00
parent 934a450290
commit a5728f990d
4 changed files with 29 additions and 6 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.4:
- Check language.txt for locale, from Zap
- Make it possible to specify the config dir on the command line.
(bug #645) - Svdb
- Speech .txt and .ts corrections, from Nic. - SvdB
+19
View File
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <locale.h>
#include "port.h"
#include "libs/graphics/gfx_common.h"
#include "compiler.h"
@@ -30,6 +31,7 @@
#include "file.h"
#include "config.h"
#include "libs/uio.h"
#include "libs/strlib.h"
int optWhichMusic;
int optWhichCoarseScan;
@@ -354,6 +356,23 @@ mountDirZips (uio_MountHandle *contentHandle, uio_DirHandle *dirHandle)
uio_freeDirList (dirList);
}
void
initLanguage (void)
{
STRING_TABLE langDef;
STRING locString;
UNICODE *str;
langDef = LoadStringTableFile (contentDir, "language.txt");
if (!langDef)
return;
locString = SetAbsStringTableIndex (langDef, 0);
str = GetStringAddress (locString);
if (str)
setlocale (LC_ALL, str);
DestroyStringTable (langDef);
}
+1
View File
@@ -48,6 +48,7 @@ void prepareContentDir (const char *contentDirName, const char **addons);
void prepareConfigDir (const char *configDirName);
void prepareMeleeDir (void);
void prepareSaveDir (void);
void initLanguage (void);
#endif
+2
View File
@@ -199,6 +199,8 @@ main (int argc, char *argv[])
prepareSaveDir ();
initTempDir ();
initLanguage ();
InitTimeSystem ();
InitTaskSystem ();