|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
Localization of Section name/description and shortcuts
Hello.
I'm looking for a sample of script that help me to modify a current .NSI script based on single language to multi-language regarding - Section name (multi-language) - Section description (multi-language) - Icon link description (multi-language). I search on different forum but I didn't find it. This the current file that I developped (but didn't work) https://mega.nz/#!XdJE3ShB!xs-AAfoJe...m_24-M_Rddnqaw It's the installer script for QEMU Thanks in advance. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
MUI already has a section description example.
What is "icon link description"? A .lnk shortcut comment? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
Hello.
Thanks for quickly reply. I tried to make it myself but probably there some syntax errors in my script. Could you please check it and provide me an idea where could be the error? When you create a program group could be a good idea to have the program description in program group localized. Ex. If you select English as language for the installer the program description in program group could be "Uninstall xxx" (xx program name) and if you select Italian could be "Disinstalla xxx". Thanks. |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
@Anders
Of course I red many web pages and tried to interpreter the explanation but surely I made something wrong. |
![]() |
![]() |
![]() |
#5 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
The Windows guidelines say that you should not create links to uninstallers and helpfiles, only your main application. IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
Yes.
Start menu shorcuts in program group. Ok for Uninstall/Help. I think for exmaple to the shortcuts that open program web site. "Open program web site" (English) "Apri sito web programma" (Italian) But my main scope is to localize section name and description (tip) showed during installation". |
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
If you want your main application shortcut to be based on a language string things get tricky.
* Option A, delete all possible names: PHP Code:
Store the shortcut name somewhere (.ini or registry) when installing and use that name when uninstalling. * Option C, shell display names (Vista+): PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
@Anders
Thanks a lot for your professional explanation Can I use also a syntax like LangString LnkName ${LANG_ENGLISH} "MyApp" LangString LnkName ${LANG_SWEDISH} "BorkApp" Section CreateShortcut "$SMPrograms\$(LnkName).lnk" "$InstDir\MyApp.exe" SectionEnd Section Uninstall Delete "$SMPrograms\$(LnkName).lnk" SectionEnd Of course you version is more complete because delete all links in any languages. In my example uninstall only a link in the same single language. |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
You can but you need to set the correct language in un.onInit. MUI might do it for you if you are using its registry defines and language macros.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
@Anders
Thank a lot for your help. I completed the script and now it works the mouldes name as multilanguage. can I define the variable in a external file (one for each language)? Ex. ---- Mainscript !include installer_english_strings.nsh !include installer_swedish_strings.nsh Section CreateShortcut "$SMPrograms\$(LnkName).lnk" "$InstDir\MyApp.exe" SectionEnd Section Uninstall Delete "$SMPrograms\${LNKNAME_ENGLISH}.lnk" Delete "$SMPrograms\${LNKNAME_SWEDISH}.lnk" SectionEnd ------------- File installer_english_strings.nsh !define LNKNAME_ENGLISH "MyApp" LangString LnkName ${LANG_ENGLISH} "${LNKNAME_ENGLISH}" ------------- File installer_swedish_strings.nsh !define LNKNAME_SWEDISH "BorkApp" LangString LnkName ${LANG_SWEDISH} "${LNKNAME_SWEDISH}" Thanks. |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Yes you can do that as long as you put the !include at the correct location in your .NSI. !include is just a copy&paste of text.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: Jul 2019
Posts: 12
|
Anders
Could be in the same way for Memento section like ${MementoSection} "NppExport" NppExport Delete "$INSTDIR\plugins\NppExport.dll" Delete "$INSTDIR\plugins\NppExport\NppExport.dll" Delete "$PLUGIN_INST_PATH\NppExport\NppExport.dll" SetOutPath "$PLUGIN_INST_PATH\NppExport" !ifdef ARCH64 File "..\bin64\plugins\NppExport\NppExport.dll" !else File "..\bin\plugins\NppExport\NppExport.dll" !endif ${MementoSectionEnd} Thanks. |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Use a langstring like you do with a normal section.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|