Archive: How to use my own language files?


How to use my own language files?
Hello!
I make an installer that should be available in three different language. I use constants like this:

LangString DESC_SecPHP ${LANG_ENGLISH} "PHP Scripting Engine. (required)"

I would like to put such constants in separate files, which i will include depending of choosen language. I try to include my language file in .onInit-function, but I receive this error : "command LangString not valid in function". I have also tried with !define, but then my script would not find the constant.

Help!
Best regards, frodelan


You can put your LangString in nsh-files. And use !include "file.nsh".


It does not work. I got the same error message; "command LangString not valid in function"

/frodelan


Remove !include from function.


What do you mean? I have this code:

Function .onInit

-------
-------

${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
!include "English.nsh"
${Break}
${EndSwitch}

-------
-------
FunctionEnd

And in English.nsh I have many LangString statements.

/frodelan


From docs:

langString
...
Defines a multilingual string. This means the its value will be different (or not, it's up to you) for every language. It allows you to easily make your installer multilingual without the need to add massive switches to the script.
I think you need use code like this:
!insertmacro MUI_LANGUAGE "English"
!include "English.nsh" etc.

Multilingual example in Moreinfo
Multilingual example in Moreinfo

Multilingual example in Moreinfo plugin. Multi language in an easy extensible way in one of the demos. Will solve a lot of multilanguage language problems.
The "CustomLanguageDemo" Fully shows the power of getting the OS GUI language. I the demo a good example of how custompage localization works and could be implemented.

See the Wikipage

http://nsis.sourceforge.net/wiki/MoreInfo_plug-in

Or take a look in:

http://forums.winamp.com/showthread...hlight=moreinfo

Just try the "CustomLanguageDemo" demo included.