Skip to content
⌘ NSIS Forum Archive

How to use my own language files?

7 posts

frodelan#

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
frodelan#
It does not work. I got the same error message; "command LangString not valid in function"

/frodelan
frodelan#
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
glory_man#
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.
onad#
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



Or take a look in:



Just try the "CustomLanguageDemo" demo included.