mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
DtEncap: use system locales.
This commit is contained in:
parent
075c5db58b
commit
3c67bd0cb1
1 changed files with 5 additions and 26 deletions
|
@ -41,9 +41,6 @@
|
||||||
#include <bms/MemoryMgr.h>
|
#include <bms/MemoryMgr.h>
|
||||||
#include "DtSvcLock.h"
|
#include "DtSvcLock.h"
|
||||||
|
|
||||||
#include <XlationSvc.h>
|
|
||||||
#include <LocaleXlate.h>
|
|
||||||
|
|
||||||
/* External declarations */
|
/* External declarations */
|
||||||
|
|
||||||
extern XeString official_hostname; /* from spc-net.c */
|
extern XeString official_hostname; /* from spc-net.c */
|
||||||
|
@ -367,33 +364,15 @@ XeString *SPC_Fixup_Environment(XeString *envp,
|
||||||
myLang = SPC_Getenv((XeString)"LANG", envp);
|
myLang = SPC_Getenv((XeString)"LANG", envp);
|
||||||
if (myLang)
|
if (myLang)
|
||||||
{
|
{
|
||||||
_DtXlateDb db = NULL;
|
|
||||||
char platform[_DtPLATFORM_MAX_LEN];
|
|
||||||
int execVer;
|
|
||||||
int compVer;
|
|
||||||
char *stdLang;
|
|
||||||
XeChar *langBuf;
|
XeChar *langBuf;
|
||||||
|
|
||||||
if (_DtLcxOpenAllDbs(&db) == 0)
|
if ((langBuf = (XeChar *)malloc((strlen(myLang) + 6) * sizeof(XeChar)))
|
||||||
{
|
|
||||||
if ((_DtXlateGetXlateEnv(db, platform, &execVer, &compVer) == 0) &&
|
|
||||||
(_DtLcxXlateOpToStd(db, platform, compVer, DtLCX_OPER_SETLOCALE,
|
|
||||||
myLang, &stdLang, NULL, NULL, NULL) == 0))
|
|
||||||
{
|
|
||||||
if ((langBuf = (XeChar *)malloc((strlen(stdLang) + 6) *
|
|
||||||
sizeof(XeChar)))
|
|
||||||
!= (XeChar *)NULL)
|
!= (XeChar *)NULL)
|
||||||
{
|
{
|
||||||
sprintf(langBuf, "LANG=%s", stdLang);
|
sprintf(langBuf, "LANG=%s", myLang);
|
||||||
envp = SPC_Putenv(langBuf, envp);
|
envp = SPC_Putenv(langBuf, envp);
|
||||||
free(langBuf);
|
free(langBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(stdLang);
|
|
||||||
}
|
|
||||||
|
|
||||||
_DtLcxCloseDb(&db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue