Old 9th May 2005, 10:22   #1
Satsuki
Junior Member
 
Join Date: Jul 2004
Posts: 30
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.
++
Satsuki is offline   Reply With Quote
Old 9th May 2005, 10:34   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
i came across this some time ago. in my script i simply called a custom function right after oninit and before my installer sections.
code:
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.
Yathosho is offline   Reply With Quote
Old 9th May 2005, 12:15   #3
Satsuki
Junior Member
 
Join Date: Jul 2004
Posts: 30
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 ^^

++
Satsuki is offline   Reply With Quote
Old 9th May 2005, 18:26   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
You can also use the .onGUIInit function.
Joost Verburg is offline   Reply With Quote
Old 20th May 2005, 13:10   #5
guilhem.martin
Junior Member
 
Join Date: May 2005
Location: European Union
Posts: 9
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.
guilhem.martin is offline   Reply With Quote
Old 20th May 2005, 13:35   #6
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
Search for forum is rulez-z.
Code example here is.
Discussion.
glory_man is offline   Reply With Quote
Old 20th May 2005, 14:55   #7
guilhem.martin
Junior Member
 
Join Date: May 2005
Location: European Union
Posts: 9
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.
Attached Images
File Type: jpg halffrenchhalfenglish.jpg (4.3 KB, 197 views)
guilhem.martin is offline   Reply With Quote
Old 20th May 2005, 15:22   #8
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
Try to read here.
Hope this helps.
glory_man is offline   Reply With Quote
Old 24th May 2005, 08:58   #9
guilhem.martin
Junior Member
 
Join Date: May 2005
Location: European Union
Posts: 9
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.
guilhem.martin is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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