frodelan
15th September 2005 12:05 UTC
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
glory_man
15th September 2005 12:54 UTC
You can put your LangString in nsh-files. And use !include "file.nsh".
frodelan
15th September 2005 13:30 UTC
It does not work. I got the same error message; "command LangString not valid in function"
/frodelan
glory_man
15th September 2005 13:35 UTC
Remove !include from function.
frodelan
15th September 2005 13:42 UTC
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
15th September 2005 14:36 UTC
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
15th September 2005 16:24 UTC
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.