- NSIS Discussion
- LangString for all Languages
Archive: LangString for all Languages
crisader
2nd July 2012 15:30 UTC
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
2nd July 2012 18:19 UTC
The only strings that get translated are identified with $(^...). If you just say "foo bar" it will be "foo bar" for any language.
Yathosho
2nd July 2012 20:45 UTC
why not simple use !define for that?
crisader
9th July 2012 09:45 UTC
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
9th July 2012 11:03 UTC
You need to use ${MUI_TEXT_LICENSE_TITLE} if you use !define MUI_TEXT_LICENSE_TITLE.
Stu
crisader
9th July 2012 12:22 UTC
!define ${MUI_TEXT_LICENSE_TITLE} "foo bar"
gets ignored again.
Afrow UK
9th July 2012 15:15 UTC
I think you need to look at the manual.
!define MyConstant "my value"
...
DetailPrint "${MyConstant}"
Stu
crisader
13th July 2012 08:41 UTC
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
13th July 2012 10:46 UTC
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
13th July 2012 12:02 UTC
!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
13th July 2012 19:19 UTC
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
18th July 2012 12:19 UTC
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
18th July 2012 14:39 UTC
That's because the language strings still have the same name whereas the defines do not.
Stu