Archive: MUI multilingual licence text problem !!


MUI multilingual licence text problem !!
Hi !

I have problems with multilingual licence files. See my code below.
I try to use several diffrent licence files.

In function .onInit I use !insertmacro MUI_LANGDLL_DISPLAY and choose english or german. But when I choose german no licence text is showed and the other nsis text is german.

When I choose english the german licence text is showed and the other nsis text is english.

Whats going wrong ?

Is there a order in which I must add multilingual statements ?

Thanks ...

.jack


LicenseLangString myLicenseData ${LANG_ENGLISH} "licence\licenceEN.txt"
LicenseLangString myLicenseData ${LANG_GERMAN} "licence\licenceGE.txt"

; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(myLicenseData)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
; !insertmacro MUI_PAGE_FINISH

; !insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
; !insertmacro MUI_UNPAGE_FINISH


;-----------------------------------------------------------------------------
;Languages -------------------------------------------------------------------

!insertmacro MUI_LANGUAGE "German" ; ID = 1031
!insertmacro MUI_LANGUAGE "English" ; ID = 1033
!insertmacro MUI_RESERVEFILE_LANGDLL


I'm not sure what is wrong. I shall look into it.

-Stu


It's because you are trying to set a LicenseLangString to a language that hasn't been created yet!

Joost is going to have to do something to fix this, because there's no way you can include language files before you insert the page macro's and thus what you are trying to do is impossible with MUI at the moment.
He's going to have to add another way to set the LicenseData so that we can add it after including the languages.

If this is possible already then I appologise, but right now I cannot find anything in the MUI documentation about using different License files (it only refers to defining one and only one.)

-Stu


Is there a order in which I must add multilingual statements ?
Yes, the order matters.

Put your LicenseLangString lines AFTER the MUI_LANGAUGE ones, like this:

!insertmacro MUI_LANGUAGE "German" ; ID = 1031
!insertmacro MUI_LANGUAGE "English" ; ID = 1033

LicenseLangString myLicenseData ${LANG_ENGLISH} "licence\licenceEN.txt"
LicenseLangString myLicenseData ${LANG_GERMAN} "licence\licenceGE.txt"

(just move the two LicenseLangString lines)

pengyou that doesn't work because you have to insert the license page macro before the language macro's (and so before the LicenseLangString entries as well).

You then just get the error...
LangString "myLicenseData" is not set in language table of language ....

-Stu


pengyou that doesn't work because you have to insert the license page macro before the language macro's (and so before the LicenseLangString entries as well).
Have another look at what I said:
(just move the two LicenseLangString lines)
Just in case that is not clear enough, here is what I was suggesting:
; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(myLicenseData)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
; !insertmacro MUI_PAGE_FINISH

; !insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
; !insertmacro MUI_UNPAGE_FINISH
;-----------------------------------------------------------------------------
;Languages -------------------------------------------------------------------

!insertmacro MUI_LANGUAGE "German" ; ID = 1031
!insertmacro MUI_LANGUAGE "English" ; ID = 1033
!insertmacro MUI_RESERVEFILE_LANGDLL

LicenseLangString myLicenseData ${LANG_ENGLISH} "licence\licenceEN.txt"
LicenseLangString myLicenseData ${LANG_GERMAN} "licence\licenceGE.txt"
Notice that all I did was move the two lines I mentioned.

Here is a script I used to test this idea

Hi !

First thanks for your answers.

The licensedemo.nsi works. When I use the below order

!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)"
...

;-----------------------------------------------------------------------------
;Languages -------------------------------------------------------------------

!insertmacro MUI_LANGUAGE "German" ; ID = 1031
!insertmacro MUI_LANGUAGE "English" ; ID = 1033
!insertmacro MUI_RESERVEFILE_LANGDLL

LicenseLangString myLicenseData ${LANG_ENGLISH} "licence\licenceEN.txt"
LicenseLangString myLicenseData ${LANG_GERMAN} "licence\licenceGE.txt"

all works correct.

Many Thanks.

-jack

Originally posted by pengyou
Have another look at what I said:Just in case that is not clear enough, here is what I was suggesting:
; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(myLicenseData)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
; !insertmacro MUI_PAGE_FINISH

; !insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
; !insertmacro MUI_UNPAGE_FINISH
;-----------------------------------------------------------------------------
;Languages -------------------------------------------------------------------

!insertmacro MUI_LANGUAGE "German" ; ID = 1031
!insertmacro MUI_LANGUAGE "English" ; ID = 1033
!insertmacro MUI_RESERVEFILE_LANGDLL

LicenseLangString myLicenseData ${LANG_ENGLISH} "licence\licenceEN.txt"
LicenseLangString myLicenseData ${LANG_GERMAN} "licence\licenceGE.txt"
Notice that all I did was move the two lines I mentioned.

Here is a script I used to test this idea