Archive: langdll and oninit


langdll and oninit
hello,

i use nsis for some time but i've spotted a bug or maybe i misunderstood myself.

i want to do a multi-langual installer.

hre's a part of my script:
...
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
!include "nsiscripts\langs\langfiles\fre.nsh"
!include "nsiscripts\langs\langfiles\eng.nsh"
...
function .oninit
!insertmacro MUI_LANGDLL_DISPLAY
....
but in the function oninit i do some system verif, like directX , windows version.... and messagebox the user if there is some error or bad version.
these messagebox remain in the french language all the time.
once the oninit function over, the GUI and all message are well translated in the selected language, but not in the oninit function.

so bug or bad nsis utilisation from me ?

i could do a StrCmp $LANGUAGE witch works in oninit but i've a dozen of sentence in oninit and the installer will add more and more language (at time there's already 5 language) so it would be realy uncool to do dozen and dozen of strcomp + goto and will complex the traduction a lot.

any possible solution to use the langstring in oninit ?

thanks a lot.
++


i came across this some time ago. in my script i simply called a custom function right after oninit and before my installer sections.

Page custom PostInit
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

Section bla
; some code
SectionEnd

Function .onInit
; LangDLL code
FunctionEnd

Function PostInit
; some code
FunctionEnd

i used the MUI! if you don't, you have to replace the insertmacro commands with the fitting page commands.

Thanks a lot !!!
it's realy works great.
i've send 1 hour yesterdays on that probleme and never thought of this kind of solution ^^

++


You can also use the .onGUIInit function.


Hello all,

could someone explain me more in details the code to produce to reach the solution:
What code do you put in .onInit and PostInit (and where do you call PostInit)


The problem I encounter is similar to the one described by Satsuki I guess: I still have some French messages when checking installation and instead of the first button "cancel" I get "annuler".

Thanks in advance,

Guilhem.


Search for forum is rulez-z.
Code example here is.
Discussion.


Hi glory_man,

thank you for your answer. Yet, I'm not exactly in that case. I mean, the text which I would like to be translated is not set by myself in the .nsi file. It appears before the dialog in which you select the language (I attach you the screenshot). Note that generally this window won't have the time to display when launched locally (I have to launch it from a remote drive to get a chance to see it).
As you can see, the text is half French half English.

Have you got an idea of what can cause that?

Thanks,

Guilhem.


Try to read here.
Hope this helps.


Hi glory_man,

thank you for your answer.
Eventually, I found a solution for my problem: I installed the English version of NSIS, and then the default language for this "verifiying install(...)" message is English whatever language is set on the machine which installs it.

Regards,

Guilhem.