Old 21st August 2003, 18:11   #1
rsegal
Senior Member
 
rsegal's Avatar
 
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
Modern UI and multilanguage installers

I've recently been trying to create a multilanguage installer using the Modern UI but have run into some issues regarding some of the MUI defined constants.

The following constants,

!define MUI_INNERTEXT_LICENSE_TOP
!define MUI_INNERTEXT_LICENSE_BOTTOM

Are used for defining text on the license screen. Is there anyway to specify text for these constants in different languages within the same file?

Doing the following will not work as I expected,

!define MUI_INNERTEXT_LICENSE_TOP "Hi"
!insertmacro MUI_LANGUAGE "English"

!define MUI_INNERTEXT_LICENSE_TOP "Bonjour"
!insertmacro MUI_LANGUAGE "French"

All you get is errors because makensis sees a multiply defined constant. Is there a way using the LangDLL plugin to find the selected language at runtime and then define the constants that the Modern UI should use based on the selected language?

If the language is known before when the script is being created there are no problems because you only need to have one MUI_LANGUAGE declaration. The issues arise when you want to have a string for each language for the same Modern UI constant.
rsegal is offline   Reply With Quote
Old 21st August 2003, 21:33   #2
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
If you want to change one of the MUI language strings, use !insertmacro instead of !define.

For example:
code:
!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP "Bonjour"
!insertmacro MUI_LANGUAGE "French

This assumes you are using NSIS 2.0b4 with CVS updates.
pengyou is offline   Reply With Quote
Old 21st August 2003, 22:09   #3
rsegal
Senior Member
 
rsegal's Avatar
 
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
First, thanks for the reply pengyou.

PHP Code:
!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP "Bonjour"
!insertmacro MUI_LANGUAGE "French 
The above would seem to work, however when I try to define the same string for a different language it just shows up as blank when I run the installer.

For example,

PHP Code:
!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP "Hello"
!insertmacro MUI_LANGUAGE "English"

!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP 
"Hello in Japanese"
!insertmacro MUI_LANGUAGE "Japanese" 
In the above case the english string will be loaded but the Japanese will appear as blank text. Any thoughts?
rsegal is offline   Reply With Quote
Old 21st August 2003, 22:26   #4
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
Perhaps the problem is simply that the text string "Hello in Japanese" is not in Japanese?

If you want to see what some "real" Japanese looks like, have a look at the Japanese.nsh file in the "Contrib\Modern UI\Language files" folder under the main NSIS folder.

If you want to test things, try using English and French:
code:
!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP "Hello"
!insertmacro MUI_LANGUAGE "English"

!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_LICENSE_TOP "Hello in French"
!insertmacro MUI_LANGUAGE "French"


You should see both text strings this time.
pengyou is offline   Reply With Quote
Old 21st August 2003, 22:37   #5
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
pengyou, your code is wrong.

The code above:
code:
!define MUI_INNERTEXT_LICENSE_TOP "Hi"
!insertmacro MUI_LANGUAGE "English"

!define MUI_INNERTEXT_LICENSE_TOP "Bonjour"
!insertmacro MUI_LANGUAGE "French"

Is just fine and works for me. Are you sure you are using the right NSIS version and did not make scripting mistakes?
Joost Verburg is offline   Reply With Quote
Old 21st August 2003, 22:45   #6
rsegal
Senior Member
 
rsegal's Avatar
 
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
I still get a blank string, even if I create an installer in French.
I'm using the development snapshot from yesterday (Aug 20th) so I would think everything is up to date. Is it possible the LangDLL plugin could be causing some issues?
rsegal is offline   Reply With Quote
Old 21st August 2003, 22:50   #7
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Can you attach your script (remove files etc. so it will compile on other system)?
Joost Verburg is offline   Reply With Quote
Old 21st August 2003, 23:08   #8
rsegal
Senior Member
 
rsegal's Avatar
 
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
Sure, here is the toned down version of it. I can't even get it to compile as makensis complains of multiply defined symbols.
Attached Files
File Type: nsi multilang.nsi (1.8 KB, 107 views)
rsegal is offline   Reply With Quote
Old 21st August 2003, 23:23   #9
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
Joost,

Your code does not work on my system. I am using the latest CVS snapshot (21 August 2003, 19:44 GMT) on Win98SE.

Attached is a modified version of the standard MultiLanguage.nsi script. I have reduced it to three languages and tried adding a !define to customise the MUI_INNERTEXT_LICENSE_TOP string.

When I try to compile this script, it fails:
code:
!define: "MUI_INNERTEXT_LICENSE_TOP"="Hi-English"
!insertmacro: MUI_LANGUAGE
!insertmacro: end of MUI_LANGUAGE
!define: "MUI_INNERTEXT_LICENSE_TOP" already defined!
Error in script "C:\Program Files\panic\MultiLanguage.nsi" on line 55 -- aborting creation process

If I change the !define statements to !insertmacro ones, as described in my earlier posting, the script compiles OK.
Attached Files
File Type: nsi multilanguage.nsi (3.0 KB, 109 views)
pengyou is offline   Reply With Quote
Old 21st August 2003, 23:34   #10
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
You have not added a license page to your script. That's why you get errors.
Joost Verburg is offline   Reply With Quote
Old 22nd August 2003, 00:06   #11
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
Joost, thanks for the explanation. Some things are so obvious, I have trouble seeing them
pengyou is offline   Reply With Quote
Old 22nd August 2003, 01:04   #12
rsegal
Senior Member
 
rsegal's Avatar
 
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
Yeh thanks Joost, I definitely missed that one.

Is there anyway to localize MUI_PRODUCT?. If I try to define it for different languages I get a multiply defined symbol error.
rsegal is offline   Reply With Quote
Old 22nd August 2003, 12:09   #13
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Yes, use !undef after inserting the language file.
Joost Verburg is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump