The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: lamer on March 16, 2006, 09:31:47 PM

Title: Multilanguage suppport
Post by: lamer on March 16, 2006, 09:31:47 PM
Hi all!
I've never created apps with multilanguage support - and now I'm confused how to do that. Theoretically I know there should be Unicode files for each language (actually just INI files) that I read strings from and apply them to controls or menu items. But nothing comes of it :'( I try to use GetPrivateProfileStringW and get either rubbish or nothing. I guess it's rather a simple task - few lines of code will come in handy :bg
Thank you.
Title: Re: Multilanguage suppport
Post by: ramguru on March 17, 2006, 07:33:12 AM
Hi,
If you want multilanguage user interface the first thing you should do is to save rc files in unicode and to write the same resource in differ. language. f.e.:

10000 MENUEX
LANGUAGE 0x9, 0 //in english
BEGIN
POPUP "Languages",10005
BEGIN
MENUITEM "Change language",10006
END
END

10000 MENUEX
LANGUAGE 0x27, 0 //in lithuanian
BEGIN
POPUP "Kalba",10005
BEGIN
MENUITEM "Keisti kalbą",10006
END
END


The biggest trouble here is to make program use particular language. For menu resource this worked...

.....
.elseif eax==WM_COMMAND
mov    eax, wParam
.if eax == 10006
invoke FindResourceEx, 0, RT_MENU, 10000, 27h
invoke LoadResource,   0, eax
invoke LoadMenuIndirect,  eax
invoke SetMenu,     hWin, eax
.endif
.....

btw try to google "sdk MUI"
Title: Re: Multilanguage suppport
Post by: pmos on March 17, 2006, 09:24:37 AM
yeah..but something else shows up.
Title: Re: Multilanguage suppport
Post by: lamer on March 17, 2006, 09:27:11 AM
Hi, ramguru!
I didn't mean resource based MUI, but run-time ability to chose needed language in some combo or listbox (see Radasm-->Options-->Language). You have a unicode INI file like:
[10000]
10006=Keisti kalbą

and maps loaded strings to menu items or controls.