PDA

View Full Version : retrieving localized string in script



Ernest Mikita
07-14-2006, 01:09 PM
I want to display message box with localized string

if (AskYesNo(<this should be localized string>), YES) = YES) then
LaunchAppAndWait(SRCDIR^"DirectX\\dxsetup.exe", "", LAAW_OPTION_WAIT);
MessageBox ("Now installation will continue.", INFORMATION);
endif;

How?

AndrewRich
07-14-2006, 01:51 PM
I want to display message box with localized string

if (AskYesNo(<this should be localized string>), YES) = YES) then
LaunchAppAndWait(SRCDIR^"DirectX\\dxsetup.exe", "", LAAW_OPTION_WAIT);
MessageBox ("Now installation will continue.", INFORMATION);
endif;

How?
Assuming you've set up your InstallShield project with multiple languages.

Add the localized strings to the string tables for each language. For example, in each language's string table, set up a string entry named "MSG_INSTALL_CONTINUE" wih the localized text for that message. Then, use the LoadStringFromStringTable function:

LoadStringFromStringTable ( "MSG_INSTALL_CONTINUE", szMsg );
MessageBox ( szMsg, INFORMATION );

Ernest Mikita
07-14-2006, 02:04 PM
thanx,
hmm, I found this solution:
AskYesNo(@SOME_ID_FROM_STRING_TABLE)

what's the difference?

AndrewRich
07-14-2006, 02:26 PM
thanx,
hmm, I found this solution:
AskYesNo(@SOME_ID_FROM_STRING_TABLE)

what's the difference?
Robert or somebody, correct me if I'm wrong:

The @ operator inserts the corresponding string table entry at compile-time, like a #define. If the string table entry doesn't exist, you'll get an error or exception.

The LoadStringFromStringTable function assigns a variable the value of the string table entry. If the string table entry doesn't exist, the string remains empty.

I have a feeling there was a better reason for using LoadStringFromStringTable--and I switched my projects from using "@" to the function some time ago--but I can't remember what it was.

RobertDickau
07-14-2006, 02:43 PM
Right, LoadStringFromStringTable enables you to perform error checking, which @STRING_ID doesn't. (See "Additional Information" in the LoadStringFromStringTable help topic.)