Archive: MUI: How to override language strings?


MUI: How to override language strings?
I need to override the default language strings for:
MUI_TEXT_INSTALLING_TITLE
MUI_TEXT_INSTALLING_SUBTITLE

There are a couple of ways I have found:

a) The cleaner way is to modify Modern UI\System.nsh so that it accepts a user defined value before using the string from the language.nsh file. I suppose this modification should be made by Joost- since he owns the MUI development- though I can make it as well.

b) The other way is to use LangString to override the language strings, e.g.,
LangString MUI_TEXT_INSTALLING_TITLE ${LANG_ENGLISH} "Yada Yada Yada"
This shows the following warning:
LangString "MUI_TEXT_INSTALLING_TITLE" set multiple times for 1033, wasting space
Though this is just a warning, I like to be able to compile my scripts without any warnings/errors. Silly, I know, but that's just me.

Any other ideas?


You put this after or before the language call? Maybe modifying System.nsh (NOT TESTED!):

!define "STR_$(MUI_TEXT_INSTALLING_TITLE)"

!ifdef STR_
LangString MUI_TEXT_INSTALLING_TITLE ${LANG_ENGLISH} "Yada Yada Yada"
!endif

!undef "STR_$(MUI_TEXT_INSTALLING_TITLE)"


So will be only used this in System.nsh when don't have that language string or when the value is "".

This is not what I am trying to do. I want System.nsh to use my text instead of what's in the Language.nsh.
Actually, it is working for me when I use method b) in my original post. What I don't like is the warning about wasted space.


All Modern UI texts can be customized. Please see the Modern UI Readme for details.


I have the latest version of the ModernUI Readme from CVS.
I don't see a section in there telling me how to change any text.
I see the parts which let me customize the title & text for an installer page.
Specifically, I need to change the following text:
MUI_TEXT_INSTALLING_TITLE
MUI_TEXT_INSTALLING_SUBTITLE

Looking at System.nsh, this is what I see:


!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE

Function "${PRE}"

!insertmacro MUI_FUNCTION_CUSTOM PRE
!insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_INSTALLING_TITLE) $(MUI_TEXT_INSTALLING_SUBTITLE)

FunctionEnd
(etc...)



By comparison, for the Welcome page:

!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE

!ifndef MUI_VAR_HWND
Var MUI_HWND
!define MUI_VAR_HWND
!endif

Function "${PRE}"

!ifndef MUI_WELCOMEPAGE_TITLE
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Text" "$(MUI_TEXT_WELCOME_INFO_TITLE)"
!else
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Text" "${MUI_WELCOMEPAGE_TITLE}"
!undef MUI_WELCOMEPAGE_TITLE
!endif

!ifndef MUI_WELCOMEPAGE_TEXT
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "$(MUI_TEXT_WELCOME_INFO_TEXT)"
!else
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "${MUI_WELCOMEPAGE_TEXT}"
!undef MUI_WELCOMEPAGE_TEXT
!endif
(etc...)


Here I can clearly see that the default text from the Language.nsh file is only inserted when I have not defined an alternate text.
Similar code is not there in the first case, where there is no option for me to provide an alternate text, since the text from the Language.nsh file is included regardless.

Maybe I am missing something, so I would appreciate you pointing me in the right direction.

The MUI_HEADER_TEXT_PAGE macros handles that. You can find the settings in the Modern UI Readme (MUI_PAGE_HEADER_TEXT/MUI_PAGE_HEADER_SUBTEXT).