Skip to content
⌘ NSIS Forum Archive

LangString for all Languages

13 posts

crisader#

LangString for all Languages

Hey,
I use LangString to set the Strings of the MUI-Dialogs like so :
LangString MUI_TEXT_INSTALLING_TITLE ${LANG_ENGLISH} "foo bar"
But I want these String displayed regardless of the Localization of the Execution Environment, so that it says "foo bar" even on chinese or whatever systems, without defining the same String for every language?
Any simple solution?
demiller9#
The only strings that get translated are identified with $(^...). If you just say "foo bar" it will be "foo bar" for any language.
crisader#
Neither works for me:
!define MUI_TEXT_LICENSE_TITLE "bla"
just ignores the define and no title is displayed
LangString MUI_TEXT_LICENSE_TITLE "bla"
displays the error "LangString expects 3 parameters, got 2." at compile-time.
Afrow UK#
I think you need to look at the manual.

!define MyConstant "my value"
...
DetailPrint "${MyConstant}"

Stu
crisader#
Can you explain why you used DetailPrint?
Or was that just for the usage?
Anyway as I said I used
!define MUI_TEXT_LICENSE_TITLE "bla"
Afrow UK#
Yes that was for the usage obviously. So you have defined MUI_TEXT_LICENSE_TITLE; where have you used ${MUI_TEXT_LICENSE_TITLE}?

Stu
crisader#
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_UNPAGE_WELCOME

!define MUI_TEXT_LICENSE_TITLE "x"
!define MUI_INNERTEXT_LICENSE_TOP "x"
!define MUI_INNERTEXT_LICENSE_BOTTOM "y"
!define MUI_TEXT_LICENSE_SUBTITLE "x"
!insertmacro MUI_PAGE_LICENSE "bla.txt"
Afrow UK#
You would have saved some time by looking at the MUI/MUI2 docs. MUI_TEXT_LICENSE_TITLE is not valid. In fact, none of those defines are. They look like the defines MUI 1.0 used around the NSIS 2.0b/2.1 era.

Stu
crisader#
Thanks it finally works now.
Although I find it rather strange that the MUI 1.0 constants work with MUI 2 as long as you use LangString instead of !define
Afrow UK#
That's because the language strings still have the same name whereas the defines do not.

Stu