home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazin 1995 November
/
CD_11_95.BIN
/
share95
/
tools
/
winbatch
/
willang.wb_
< prev
next >
Wrap
Text File
|
1994-09-10
|
2KB
|
82 lines
;Language change applet for Winbatch
tab=num2char(9)
;Change to WinBatch home dir to find WWDLANG.* files
DirChange(DirHome())
MyDialogFormat=`WWWDLGED,5.0`
MyDialogCaption=`WIL Language Selector`
MyDialogX=60
MyDialogY=79
MyDialogWidth=289
MyDialogHeight=146
MyDialogNumControls=6
MyDialog01=`2,66,278,56,ITEMBOX,Choice,DEFAULT`
MyDialog02=`20,22,270,DEFAULT,VARYTEXT,current,""`
MyDialog03=`54,126,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
MyDialog04=`148,126,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
MyDialog05=`10,6,114,DEFAULT,STATICTEXT,DEFAULT,"Current Language is:"`
MyDialog06=`10,46,272,DEFAULT,STATICTEXT,DEFAULT,"Select desired language"`
;Determine current language
Current=inireadpvt("Main","Language","NONE","WWWBATCH.INI")
if Current=="NONE"
current="English"
else
if strlen(Current)!=3 then current="enu"
current=IniReadPvt("Main","Description","Unknown",strcat(DirGet(),"WWWDLANG.",current))
endif
LangFiles=strupper(FileItemize("WWWDLANG.*"))
a=ItemLocate("WWWDLANG.DLL",LangFiles," ")
if a!=0 then LangFiles=ItemRemove(a,LangFiles," ")
LangFiles=ItemSort(LangFiles," ")
LangCount=ItemCount(LangFiles," ")
if LangCount==0
Message("Language","No WWWDLANG.* Language files found. Using English")
return
endif
LangList=""
for i=1 to LangCount
lfile=ItemExtract(i,LangFiles," ")
Lang=IniReadPvt("Main","Description","NONE",strcat(DirGet(),lfile))
if Lang=="NONE" then Lang=FileExtension (lfile)
if i<LangCount then LangList=strcat(LangList,Lang,tab)
else LangList=strcat(LangList,Lang)
next
:tryagain
choice=LangList
Dialog("MyDialog")
if Choice=="" then return
if ItemCount(Choice,tab)>1
Display(4,"Language","You may only select one language")
goto tryagain
endif
a=ItemLocate(choice,LangList,tab)
lfile=ItemExtract(a,LangFiles," ")
ext=FileExtension(lfile)
if ext=="ENU"
IniDeletePvt("Main","Language","WWWBATCH.INI")
Message("English chosen as langauge","DLL Will use internal strings instead of language file")
else
IniWritePvt("Main","Language",ext,"WWWBATCH.INI")
Message("Language","Language set to %Choice%")
endif
IntControl(26,0,0,0,0) ;Tell DLL to reset language strings
return