Archive: Translation of DotNET Module


Translation of DotNET Module
Hi,

my application for what I want to create a setup for, needs .NET Framework to run, so I added the DOTNET Modul "DotNET.nsh" (http://nsis.sourceforge.net/DotNET) to my installation.

I also want to have two languages in installation (english and german). The DOTNET Module only supports one, so I replaced the stings form the DOTNET Modul with constants.

My installation need these files:
- setup.nsh (Main file)
- DotNET.nsh
- LogicLib.nsh
- System.nsh
- English.nsh
- German.nsh


In "DotNET.nsh" I changed this


DetailPrint "Completed cleaning temporary files."

into that

DetailPrint "${MUI_DOTNET_CLEANING_COMPLETE}"


and added the definition in "English.nsh"

!define MUI_DOTNET_CLEANING_COMPLETE "Completed cleaning temporary files."


and in "German.nsh"

!define MUI_DOTNET_CLEANING_COMPLETE "Das Entfernen der temporären Dateien wurde erfolgreich abgeschlossen."


When I complie my script I get an error:
!define MUI_DOTNET_CHECKING already defined


Why? Many other consts were declared like this before?!

Thanks a lot for any help!

progger

You need to declare a language string, not a define. The MUI macros handle that for you in Contrib\Modern UI\Language files\*.nsh. If you write your own language file, either create your own macros that'll create the language strings, or simply declare language strings in your language files.

LangString MUI_DOTNET_CHECKING ${LANG_ENGLISH} "Text here..."

First, thanks for your help!

You need to declare a language string, not a define.
Why are there many "defines" in the language files (English.nsh for example)?

It looks like that there have to be a way to define the Language Strings like in the existings Languge files.

But why the compiler says:

1 warning:
unknown variable/constant "{MUI_DOTNET_CHECKING}" detected, ignoring (C:\...\setup.nsi:79)


What do I have to add in "System.nsh" that it works?

Language strings use curved bracket parenthesis and not curly ones.

e.g.
LangString String ${LANG_ENGLISH} "text"
-> $(String)

-Stu


As I said, the MUI macros handle converting the defines into language strings. More specifically, MUI_LANGUAGEFILE_END in Contrib\Modern UI\System.nsh, which used at the end of each language file, handles that. If you wish, you could create your own set of macros. However, it's not required and you can use simple language strings.