Archive: how do I find out the current language setting?


how do I find out the current language setting?
My question is rather simple, but I am not smart
enough to solve it. ;-)Please pay attention to
the following code.

#################################
Function .onInstSuccess
MessageBox MB_OK "Installation Succeeded$\r$\n"
FunctionEnd
#################################

I dont mind printing out the msg in English...
that is only in the case when user chose English
as the installation language.

However, If the user chose different language...
say...french for instance... then I like to have
the message box to print out "bonjour."
If spanish then "hola," if italian then "ciao,"
...so on and so forth...

I can define all those messages in different languages.
However, before I apply the message to the msgbox,
I need to find out what is the current language setting is.

I need to have some input from user.
Since my program operates in many languages,
I want my program to interpret with users
in different languages as well.


So... should I code something like as follows?

#################################
Function .onInstSuccess
${If} $LanguageSetting = "English"
MessageBox MB_OK "Installation Succeeded$\r$\n"
${If} $LanguageSetting = "Spanish"
MessageBox MB_OK "La Instalación Tuvo éxito$\r$\n"
${If} $LanguageSetting = "Spanish"
MessageBox MB_OK "L'Installation A réussi$\r$\n"
FunctionEnd
#################################

I dont know... Im not even sure if my code should
look like above...; or is there a better way then
using if/else statement? NSIS does perform somewhat
like C++, and MFC. But at the same time its hardder
to figure it out.

I somehow managed to solve all other problems but this.
Please guys... I will be gald to take any advise.

Thx in advance


There is an automation to handle languages in NSIS.

Just have a look at that:


!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "English"
;; here you declare which languages you wanna support

LangString WELCOME_MSG ${LANG_FRENCH} "Bienvenue !!!"
LangString WELCOME_MSG ${LANG_ENGLISH} "Welcome !!!"
LangString END_MSG ${LANG_FRENCH} "C'est fini."
LangString END_MSG ${LANG_ENGLISH} "The end."
;; you can define all the translated messages you want

;; Here an example how to use
MessageBox MB_OK "$(WELCOME_MSG)" ;; pay attention: $() and not ${} as for variables


As for the if-then-else features, have a look at your NSIS_INSTALL_PATH\include\LogicLib.nsh, also in \example\LogicLib.nsi and you will deal with macros like ${If} ${Else} ${EndIf} and so on...

Gal'