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:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.4:
|
Changes towards version 0.4:
|
||||||
|
- Check language.txt for locale, from Zap
|
||||||
- Make it possible to specify the config dir on the command line.
|
- Make it possible to specify the config dir on the command line.
|
||||||
(bug #645) - Svdb
|
(bug #645) - Svdb
|
||||||
- Speech .txt and .ts corrections, from Nic. - SvdB
|
- Speech .txt and .ts corrections, from Nic. - SvdB
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <locale.h>
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "libs/uio.h"
|
#include "libs/uio.h"
|
||||||
|
#include "libs/strlib.h"
|
||||||
|
|
||||||
int optWhichMusic;
|
int optWhichMusic;
|
||||||
int optWhichCoarseScan;
|
int optWhichCoarseScan;
|
||||||
@@ -354,6 +356,23 @@ mountDirZips (uio_MountHandle *contentHandle, uio_DirHandle *dirHandle)
|
|||||||
uio_freeDirList (dirList);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -45,9 +45,10 @@ extern uio_DirHandle *saveDir;
|
|||||||
extern uio_DirHandle *meleeDir;
|
extern uio_DirHandle *meleeDir;
|
||||||
|
|
||||||
void prepareContentDir (const char *contentDirName, const char **addons);
|
void prepareContentDir (const char *contentDirName, const char **addons);
|
||||||
void prepareConfigDir(const char *configDirName);
|
void prepareConfigDir (const char *configDirName);
|
||||||
void prepareMeleeDir(void);
|
void prepareMeleeDir (void);
|
||||||
void prepareSaveDir(void);
|
void prepareSaveDir (void);
|
||||||
|
void initLanguage (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -191,14 +191,16 @@ main (int argc, char *argv[])
|
|||||||
sfxVolumeScale = options.sfxVolumeScale;
|
sfxVolumeScale = options.sfxVolumeScale;
|
||||||
speechVolumeScale = options.speechVolumeScale;
|
speechVolumeScale = options.speechVolumeScale;
|
||||||
|
|
||||||
initIO();
|
initIO ();
|
||||||
prepareContentDir (options.contentDir, options.addons);
|
prepareContentDir (options.contentDir, options.addons);
|
||||||
HFree ((void *) options.addons);
|
HFree ((void *) options.addons);
|
||||||
prepareConfigDir (options.configDir);
|
prepareConfigDir (options.configDir);
|
||||||
prepareMeleeDir ();
|
prepareMeleeDir ();
|
||||||
prepareSaveDir ();
|
prepareSaveDir ();
|
||||||
initTempDir();
|
initTempDir ();
|
||||||
|
|
||||||
|
initLanguage ();
|
||||||
|
|
||||||
InitTimeSystem ();
|
InitTimeSystem ();
|
||||||
InitTaskSystem ();
|
InitTaskSystem ();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user