Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th January 2012, 07:49   #1
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Setting the language on .myGuiInit

I saw I think every thread about this. I understood that I can get parameters in .myGuiInit with ${GetParameters}. When I run a .exe file from another setup I write this

code:

ExecWait '" $DESKTOP\myfolder\myexefile.exe" $LANGUAGE' $0


because I want that myexefile.exe is of the same language of the main setup.
in myexefile.exe in .myGuiInit function I wrote this code

code:

Function .myGuiInit
${GetParameters} $0
FunctionEnd


In $0 variable I find the language code sent by exec for example for italian I found 1040, for spanish 1034 of for french 1036 anyway I found the right code of the chosen language.
I tried setting $LANGUAGE with this code or with ${LANG_SPANISH} if I found the spanish code but this way doesn't work. Installation files page is shown in italian.(my OS language)
How can I make the language change according to the code in .myGuiInit?

I hope I was clear my english sucks
Thnks
bennaloz is offline   Reply With Quote
Old 20th January 2012, 08:40   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,164
Send a message via ICQ to Yathosho
1. i'd probably add a switch to make sure you get only the language code (eg /L=$LANGUAGE)

2. according to languages.nsi, you should set the language in the onInit function
Yathosho is offline   Reply With Quote
Old 20th January 2012, 08:54   #3
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
So have I to load the correct language file corresponding to the input language code?

Edit: I didn't say I am using MUI_LANGDLL_DISPLAY onInit to set the installer language
bennaloz is offline   Reply With Quote
Old 20th January 2012, 09:31   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,164
Send a message via ICQ to Yathosho
Quote:
Originally Posted by bennaloz View Post
I didn't say I am using MUI_LANGDLL_DISPLAY onInit to set the installer language
you didn't, but it still demonstrates how to do it: StrCpy $LANGUAGE <LANG_ID>

or

;commandline should contain /L=<LANG_ID>
${GetParameters} $0
${GetOptions} $0 "/L=" $LANGUAGE
Yathosho is offline   Reply With Quote
Old 20th January 2012, 11:05   #5
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Quote:
Originally Posted by Yathosho View Post
StrCpy $LANGUAGE <LANG_ID>
<LANG_ID> means 1040 for italian or means ${LANG_ITALIAN}?
Because I tried but it seems not work. I did it in .onInit function.
bennaloz is offline   Reply With Quote
Old 20th January 2012, 11:19   #6
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Quote:
Originally Posted by Yathosho View Post

;commandline should contain /L=<LANG_ID>
${GetParameters} $0
${GetOptions} $0 "/L=" $LANGUAGE
Instead when I write this code on .onInit function $LANGUAGE is empty and $0 contains the language code.
If I chose spanish in $0 I find 1034 and writing
StrCpy $LANGUAGE $0
the installer remain in italian. I can't understand where I am wrong
bennaloz is offline   Reply With Quote
Old 24th January 2012, 07:43   #7
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Function .onInit
StrCpy $LANGUAGE 2057 ;to set the english setup language does not work
FunctionEnd
or
Function .onInit
${GetParameters} $0
${GetOptions} $0 "/L=" $LANGUAGE
FunctionEnd

I think $0 must contain <LANG_ID> (for example 1040,2057 it depeds) but it's empty.
So how can i get it work?
bennaloz is offline   Reply With Quote
Old 24th January 2012, 11:25   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
How have you run your setup executable? As Yathosho says you need to give it /L=#.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 25th January 2012, 06:33   #9
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
I run ExecWait '"MySetup.exe" <LANG_ID>' without /l. I thought it was the same retrieving the <LANG_ID> on .onInit function and put it in $LANGUAGE without look for /l. Ok now it works with
ExecWait '"mysetup.exe" /l $LANGUAGE'
and onInit ${GetOptions} $0 /l $LANGUAGE
but If I chose French when I exec mysetup.exe I found in $LANGUAGE 1036 (french lang_id), but mysetup.exe is in english -.-'' and my OS is italian. Mmm boh.
Am I forgetting something?

Edit: When I run mysetup.exe I found the right languade id onInit but then I checked again $LANGUAGE while installation is in progress and I found 1033 (english U.S.) I tried with different languages and the result is the same. I found during the installation 1033. I think I am forgetting something to set the language.
Another clarification... I am using Unicode nsis. If it makes some difference

Last edited by bennaloz; 25th January 2012 at 09:05.
bennaloz is offline   Reply With Quote
Old 25th January 2012, 09:44   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Look at section 4.10.1 in the manual.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 25th January 2012, 11:13   #11
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Quote:
Originally Posted by Afrow UK View Post
Look at section 4.10.1 in the manual.
Already read it.Infact my first language is english like it sais. I am sorry I was sure english means UK english and not US english. Now I tried to print $LANGUAGE if I chose english and it's 1033. Solved. I didn't put !insertmacro MUI_LANGUAGE in every setup -.-'' I didn't think it was necessary surely you thought it was obvoius. Thanks for the patience. Anyway How can I load UK English? I checked in MultiLanguages.nsi but I found only English (1033 is US english while 2057 is UK english).I should need 2057. Do you know or somebody else know it?
bennaloz is offline   Reply With Quote
Old 25th January 2012, 11:19   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
You need to create your own nlf and nsh file for it (you can submit it as well in the translations forum).

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 25th January 2012, 11:27   #13
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Quote:
Originally Posted by Afrow UK View Post
You need to create your own nlf and nsh file for it (you can submit it as well in the translations forum).
Ok I'll see. Thank you again
bennaloz is offline   Reply With Quote
Reply
Go Back   Winamp 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