PDA

View Full Version : Multilingual follow-up



David Webber
07-09-2007, 04:33 AM
Following up your suggestion about the custom language selector, I can see how to all but one crucial thing. [I'm afraid I'm really getting to the nitty gritty here :( ]

%CURLNG% (as I understand it) will tell me the user's native language - and so in principle I can check this right at the beginning, and bring up a custom "choose a language" dialogue in that language.

The only fly in the ointment is that the languages I have available are

1033 (US English)
1034 (Traditional Spanish)
1036 (Standard French)
1043 (Standard Dutch)
....

Now I don't mind about not having *proper* English - honest ;) - (with a licence instead of a license) but it would be fairly crucial to be able to detect %CURLNG%=2057 (and other non-US English dialects) and set %SELLNG% to be 1033.

Similarly it would be useful if all varieties of Spanish, French, and Dutch could set %SELLNG% to be the included dialect above.

In the Windows API, PRIMARYLANGID( langid ), where langid is a WORD, returns the primary language id - 9 for all kinds of English, 10 for all kinds of Spanish, etc. So in principle I could compare the results of passing (a) %CURLNG% and (b) each of the available language codes to PRIMARYLANGID and select the appropriate language from the result.

I can provide a function in a DLL to do the comparison, but is there a method in SetupBuilder which means I don't have to?

Dave

linder
07-09-2007, 05:16 AM
Hi Dave,

I see what you mean.

A call to the GetCurrentLanguage() Windows API defines the value of the %CURLNG% variable.

{SELLNG} is an "internal" installer variable (read-only). The "Set Active Setup Language" or the Show Language Dialog can set the value of {SELLNG}.

Unfortunately, there is no method in SetupBuilder to get the "primary language id".

Does this help?

Friedrich

David Webber
07-09-2007, 06:28 AM
Ok. At least I know I haven't missed anything.

I'm already using a DLL to do some tasks. I'll add a ComparePrimaryLanguage( id1, id2 ) method to it in order to do this.

Meanwhile, could I ask you to add it to your burgeoning suggestions box! :)

Thanks, as ever, for your rapid response.

Dave

linder
07-09-2007, 06:37 AM
Great :) Thank you!

It's on the drawing board now ;)

Friedrich