Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change the language?
#1
I want to be able to change more than one language in my program.

Ex: english, Japanese and etc

I would like to use a combo box to separate the languages and change the language of the tooltip, button, Static etc.

Please advise which command should be used.
#2
Function Dialog205
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "`OK"
;2 Button 0x54030000 0x4 168 116 48 14 "`Cancel" "`ttCancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040400 "*" "" "" ""

ARRAY(lpstr) aLang.create(2)
lpstr lang

lang=
;OK, OK 1
;Cancel, Cancel 1
;ttCancel, Tooltip 1
aLang[0]=lang

lang=
;OK, OK 2
;Cancel, Cancel 2
;ttCancel, Tooltip 2
aLang[1]=lang

int iLang=ListDialog("Language 1[]Language 2")-1
if(iLang<0) ret

IStringMap m._create
m.AddList(aLang[iLang] "csv")
REPLACERX r.frepl=&sub.Callback_str_replacerx; r.paramr=&m
dd.replacerx("(?<='')(`.+?)(?='')" r)
;out dd

if(!ShowDialog(dd 0 0)) ret


#sub Callback_str_replacerx
function# REPLACERXCB&x

IStringMap& m=+x.rrx.paramr
lpstr repl=m.Get(x.match+1)
if(repl) x.match=repl
#3
It has been able to change the language, thank you very much.
Can not change string in combo box?

Function Function12
Code:
Copy      Help
\Dialog_Editor

out
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 ComboBox 0x54230243 0x0 16 28 96 213 ""
;1 Button 0x54030001 0x4 116 116 48 14 "`OK"
;2 Button 0x54030000 0x4 168 116 48 14 "`Cancel" "`ttCancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

ARRAY(lpstr) aLang.create(2)
lpstr lang

lang=
;OK, OK 1
;Cancel, Cancel 1
;ttCancel, Tooltip 1
aLang[0]=lang

lang=
;OK, OK 2
;Cancel, Cancel 2
;ttCancel, Tooltip 2
aLang[1]=lang

int iLang=ListDialog("Language 1[]Language 2")-1
if(iLang<0) ret

IStringMap m._create
m.AddList(aLang[iLang] "csv")
REPLACERX r.frepl=&sub.Callback_str_replacerx; r.paramr=&m
dd.replacerx("(?<='')(`.+?)(?='')" r)
out dd

;if(!ShowDialog(dd 0 0)) ret
str controls = "3"
str cb3="&Default[]test1[]test2[]test3"
if(!ShowDialog(dd 0 &controls)) ret


#sub Callback_str_replacerx
function# REPLACERXCB&x

IStringMap& m=+x.rrx.paramr
lpstr repl=m.Get(x.match+1)
if(repl) x.match=repl
#4
Macro Macro2732
Code:
Copy      Help
sel iLang
,case 0
,cb3="&Default A[]test1 A"
,
,case 1
,cb3="&Default B[]test1 B"
,


Forum Jump:


Users browsing this thread: 1 Guest(s)