- NSIS Discussion
- Multilanguage
Archive: Multilanguage
lorenzop
30th November 2005 11:21 UTC
Multilanguage
Hi,
I want make a multilanguage installer.
I've inserted this string in the script:
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Spanish"
But the Uninstaller start (automatically) in Italian.
Why?
Thanks.
glory_man
30th November 2005 13:21 UTC
Is there next line in your un.onInit function
!insertmacro MUI_UNGETLANGUAGE
lorenzop
30th November 2005 13:34 UTC
This is my un.onInit function:
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Sei sicuro di voler completamente rimuovere $(^Name) e tutti i suoi componenti?" IDYES +2
Abort
FunctionEnd
Thanks.
glory_man
30th November 2005 14:27 UTC
Uninstaller start in Italian even if another language was selected during install?
lorenzop
30th November 2005 14:38 UTC
Sorry,
but if I select "english" during the installation..the uninstallation start in "italian".
Why?
Thanks.
glory_man
30th November 2005 14:50 UTC
What information store in registry under your
"MUI_LANGDLL_REGISTRY_ROOT\MUI_LANGDLL_REGISTRY_KEY\MUI_LANGDLL_REGISTRY_VALUENAME"
lorenzop
30th November 2005 15:44 UTC
Hi,
in which registry?
In Windows Registry, I don't find any MUI_LANGDLL_REGISTRY_ROOT\...
Thanks.
lorenzop
30th November 2005 16:30 UTC
I'm found the registry..
the code are:
ITA -> 1040
ENG -> 1033
FRA -> 1036
DEU -> 1031
ESP -> 1034
thanks.
glory_man
30th November 2005 16:37 UTC
From MUI doumentation:
To remember to users preference, you can define a registry key.
Note: These defines should be set before inserting the installation page macro.
MUI_LANGDLL_REGISTRY_ROOT root
MUI_LANGDLL_REGISTRY_KEY key
MUI_LANGDLL_REGISTRY_VALUENAME value_name
The registry key to store the language. The users preference will be remembered. You can also use it for the uninstaller to display the right language. Don't forget to remove this key in the uninstaller.
You need to define this values to store language selection in windows registry.
ADD:
So, instead MUI_LANGDLL_REGISTRY_ROOT, etc. use it's values you define.
lorenzop
2nd December 2005 16:15 UTC
Thanks,
but now I've another problem.
I need to customize that MessageBox (see the code):
LangString msgRimozione1 ${LANG_ITALIAN} "Sei sicuro di voler completamente rimuovere"
LangString msgRimozione1 ${LANG_ENGLISH} "Are you sure of wanting completely to remove"
LangString msgRimozione1 ${LANG_FRENCH} "Êtes vous sûr de vouloir complètement enlever"
LangString msgRimozione1 ${LANG_GERMAN} "Sind Sie sicher von entfernen vollständig wünschen"
LangString msgRimozione1 ${LANG_SPANISH} "¿Usted seguro desear completo para quitar"
LangString msgRimozione2 ${LANG_ITALIAN} "e tutti i suoi componenti?"
LangString msgRimozione2 ${LANG_ENGLISH} "and all its members?"
LangString msgRimozione2 ${LANG_FRENCH} "et tous ses membres?"
LangString msgRimozione2 ${LANG_GERMAN} "und alle seine Mitglieder?"
LangString msgRimozione2 ${LANG_SPANISH} "y todos sus miembros?"
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(msgRimozione1) $(^Name) $(msgRimozione2)" IDYES +2;
Abort
FunctionEnd
But when start the uninstaller, the messege doesn't switch with the language.
Thanks,
Lorenzo.
glory_man
5th December 2005 13:07 UTC
I know this problem. Here and here discussion.
You need to use $LANGUAGE variable in un.onInit function and define language string here.
!include "LogicLib.nsh"
...
var mess
Function un.onInit
...
${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
StrCpy $mess "English message"
${Break}
${Case} ${LANG_RUSSIAN}
StrCpy $mess "Russian message"
${Break}
${Case} ${LANG_ITALIAN}
StrCpy $mess "Italian message"
${Break}
${EndSwitch}
MessageBox MB_OK "$mess"
FunctionEnd