Old 1st April 2016, 21:03   #1
htome
Junior Member
 
Join Date: May 2009
Posts: 16
Reset/Change $LANGUAGE after .oninit

Hi everyone,

I am trying to change NSIS dialog language after .oninit and not sure if this is possible at all.

I found some posting which are really old saying that after .oninit language cannot be changed.

I was wondering if this feature has been added to NSIS lately.

Is there any way to reload NSIS Dialogs with another $LANGUAGE after .oninit?

Thanks in advance!
htome is offline   Reply With Quote
Old 1st April 2016, 22:35   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
No, it is still not possible.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd April 2016, 06:54   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 541
Send a message via ICQ to T.Slappy
Is there any reason why this should be added as feature?

Once user selects the language (e.g. Slovak in my case) you want to switch it to another language (e.g. ENglish) ?


But Why?

Cool looking installers with custom design: www.graphical-installer.com
Design NSIS setup Pages easily: www.install-designer.com
Build NSIS installers in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 3rd April 2016, 17:20   #4
Coby
Junior Member
 
Join Date: Feb 2016
Posts: 48
I saw this feature to change the language to Piriform CCleaner installer
Coby is offline   Reply With Quote
Old 3rd April 2016, 18:03   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
Quote:
Originally Posted by Coby View Post
I saw this feature to change the language to Piriform CCleaner installer
Did you actually try it? If you do you will see that they re-launch the installer. For example, if I choose to switch to Swedish it starts itself again as '"c:\whatever\ccsetup516.exe" /L=1053'...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th April 2016, 06:16   #6
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 541
Send a message via ICQ to T.Slappy
Quote:
Originally Posted by Anders View Post
Did you actually try it? If you do you will see that they re-launch the installer. For example, if I choose to switch to Swedish it starts itself again as '"c:\whatever\ccsetup516.exe" /L=1053'...
Nice

@Coby: This is a way how to do it without any change in sources.

Cool looking installers with custom design: www.graphical-installer.com
Design NSIS setup Pages easily: www.install-designer.com
Build NSIS installers in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 4th April 2016, 13:18   #7
htome
Junior Member
 
Join Date: May 2009
Posts: 16
Restarting was the only way to change the language, but I want to change that behavior.
Does anyone know where in the sources we can change this?
Has anyone accomplished this or requested this feature before?
Please let me know.
Many thanks!
htome is offline   Reply With Quote
Old 4th April 2016, 14:26   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
https://sourceforge.net/p/nsis/feature-requests/320/
https://sourceforge.net/p/nsis/feature-requests/221/

You would have to call set_language() every time $language is changed or add a separate instruction. If it actually works or not is another question, I have personally never tried it.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th April 2016, 14:37   #9
htome
Junior Member
 
Join Date: May 2009
Posts: 16
Is set_language() a valid NSIS script function?

Would it be something like this:
!macro SetLanguage sLanguage
StrCpy $LANGUAGE ${sLanguage}
Call set_language
!macroend

Or set_language is actually a C++ call, so I would have to change NSIS C++ source, recompile and etc.

Thanks
htome is offline   Reply With Quote
Old 4th April 2016, 14:59   #10
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
Yes it is a C function in the source. Obviously if there was a NSIS instruction for this we would have just told you at the start of the thread.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th September 2016, 18:19   #11
Kuppy
Junior Member
 
Join Date: Sep 2016
Posts: 34
To solve this problem, now you can change the language after .onInit
Attached Files
File Type: nsi Change Language.nsi (10.5 KB, 110 views)
Kuppy is offline   Reply With Quote
Old 28th September 2016, 15:27   #12
Kuppy
Junior Member
 
Join Date: Sep 2016
Posts: 34
Update.
Now you can change the color of the window
Attached Files
File Type: nsi Change Language.nsi (45.8 KB, 92 views)
Kuppy is offline   Reply With Quote
Old 28th September 2016, 21:13   #13
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
Exclamation

Quote:
Originally Posted by Kuppy View Post
To solve this problem, now you can change the language after .onInit
Kuppy/Coby/Adryan/catssoft, why does your sample include the/my MoveAnywhere plug-in and regional windows? It has nothing to do with the question. Please only provide code to solve the question, adding other code that is unrelated to the problem only complicates things. I have given you so many warnings already and will ban your new account if you don't start listening...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th October 2016, 05:11   #14
eliotime3000
Junior Member
 
Join Date: Oct 2016
Posts: 19
I've seen this on HM NIS Edit script generator.

This is the code in question:

code:
; Language files
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "SpanishInternational"



But in the language chooser form are summoned on this code:

code:
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd



Maybe another extra macro can solve this issue.
eliotime3000 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
$language, .oninit

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump