Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Translation of DotNET Module (http://forums.winamp.com/showthread.php?t=251479)

progger 19th July 2006 11:01

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
code:

DetailPrint "Completed cleaning temporary files."


into that
code:

DetailPrint "${MUI_DOTNET_CLEANING_COMPLETE}"



and added the definition in "English.nsh"
code:

!define MUI_DOTNET_CLEANING_COMPLETE "Completed cleaning temporary files."



and in "German.nsh"
code:

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



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


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

Thanks a lot for any help!

progger

kichik 19th July 2006 16:24

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.
code:
LangString MUI_DOTNET_CHECKING ${LANG_ENGLISH} "Text here..."

progger 21st July 2006 11:35

First, thanks for your help!

Quote:

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:
code:

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?

Afrow UK 21st July 2006 12:37

Language strings use curved bracket parenthesis and not curly ones.

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

-Stu

kichik 21st July 2006 12:51

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.


All times are GMT. The time now is 04:59.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.