Hello,
can anybody tell me how to create a custom page with InstallOptions and multi-language support?
Example - I created an ini-File with a field like this:
[Field 1]
Type=label
Text=Summary:
Left=0
Right=-1
Top=0
Bottom=10
How can I change the value for Text depending on the chosen installation language? I guess there is a simple answer, but I haven't found it yet. Any help would be appreciated.
InstallOptions and multi-language support?
5 posts
Hi Jim,
i'd the same problem (multilanguage + installoption) and found only the solution, make for every language one file.
I found the following way, works good for me and doesn't make more work (lines) in my setup script:
First i define all language ini's:
Example:
In the second step, i do follwing:
I hope, this solution helps you.
p7
i'd the same problem (multilanguage + installoption) and found only the solution, make for every language one file.
I found the following way, works good for me and doesn't make more work (lines) in my setup script:
First i define all language ini's:
Example:
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "OptionsABC-1031.ini" "OptionsABC-1031"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "OptionsABC-1033.ini" "OptionsABC-1033" 1031 is the value for german, 1033 for english.In the second step, i do follwing:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "OptionsABC-$LANGUAGE" The variable $LANGUAGE contains the current language code (if the user select for example german, the code is 1031). I hope, this solution helps you.
p7
Well once again, look in the Moreinfo plugin example 😉
a customepage multilanguage example there... you do not even need the plugin for using this technique, very extensible and maintainable.
a customepage multilanguage example there... you do not even need the plugin for using this technique, very extensible and maintainable.
Or you can do what I do. Have a file with all your LangStrings and call a function after you extract the ini file and before you call initdialog and do:
This gets rid of having to use seperate INI files.
LangString localizedString ${LANG_ENGLISH} "bla"
LangString localizedString ${LANG_JAPANESE} "japanese bla"
Function SetIniFile
WriteRegStr "$PLUGINSDIR\file.ini" "Field 1" "Text" "$(localizedString)"
FunctionEnd
Originally posted by onadExcellent! Just what I've been looking for. This should be put into the FAQ or even the NSIS documentation. I guess lots of people will need this info.
[B]Well once again, look in the Moreinfo plugin example 😉
Thanks!!
PS goldy1064, your solution is also quite good, but onad's is more easily maintainable in the long run, I guess.