pegase06
12th June 2007 11:14 UTC
Manage language
Hello,
I use many MessageBox in my setup.
MessageBox MB_OK|MB_ICONEXCLAMATION "warning you should..."
I have define two language in my setup :
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
and the user can choose the langage due to
!insertmacro MUI_LANGDLL_DISPLAY
How to manage language for my messagebox ?
I want have two variable for the text show in the MessageBox: one for english, one for french.
MessageBox MB_OK|MB_ICONEXCLAMATION $text_msg_box1
I search any example.
Thanks for help.
Red Wine
12th June 2007 11:32 UTC
See the included example languages.nsi :)
pegase06
13th June 2007 11:01 UTC
the function
LangString Sec1Name ${LANG_FRENCH} "French section #1"
can't be use with
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
and
!insertmacro MUI_LANGDLL_DISPLAY
?
I have write :
...
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
LangString Sec1Name ${LANG_ENGLISH} "English section #1"
LangString Sec1Name ${LANG_FRENCH} "French section #1"
...
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
MessageBox MB_YESNO|MB_ICONQUESTION "$(Sec1Name)" IDOK
FunctionEnd
...
But it doesn't works. The text display by the messagebox is always in french.
Red Wine
13th June 2007 13:05 UTC
Discussed several times that in function .onInit where the gui isn't yet initialized you can't use language strings, go to function .onGUIInit instead.
Perform a forum search about that and you'll find several related threads and examples as well.