Old 15th September 2005, 09:20   #1
Beorne
Junior Member
 
Join Date: May 2004
Location: ITALY
Posts: 5
defining wich language file from a configuration file

Up to now I defined wich language file to use with NSIS with:

!ifdef ITA
LoadLanguageFile 'Italian.nlf'
!endif

Now I have an external configuration file containing my deploy configuration (includung the language) that I read with the very useful command

${ConfigRead} 'configfile' 'Language = ? $R5

But the latter is an instruction that has to be in a section, and LoadLanguageFile is a command that cannot be placed in a section.

How could I read a configuration file and on the basis of the parameter load the right language file?

Thank you very much
Beorne is offline   Reply With Quote
Old 15th September 2005, 09:23   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
in my installer i'm using this in the onInit function
code:
ReadINIStr $0 "$EXEDIR\rwparam.ini" "RunWithParameters" "Language"
StrCpy $LANGUAGE "$0"


that StrCpy command shouldn't be necessary in your script, just use $LANGUAGE in the ReadINIStr command.
Yathosho is offline   Reply With Quote
Old 15th September 2005, 13:27   #3
Beorne
Junior Member
 
Join Date: May 2004
Location: ITALY
Posts: 5
This does not resolve my problem
I have put
${ConfigRead} "configfile" "lang = " $R5
StrCpy $LANGUAGE $R5
in OnInit but don't work

I have to read the language from a parameter file, then set the default NSIS strings to that language, like using
LoadLanguageFile "C:\Italian.nlf"

Simply put I have to localize the installer on the basis of a parameter on file
Beorne is offline   Reply With Quote
Old 15th September 2005, 15:13   #4
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
${ConfigRead} "configfile" "lang = " $R5
MessageBox MB_OK "Language - $R5"
StrCpy $LANGUAGE $R5

What does this MB show?
And attach script (if you can).
glory_man is offline   Reply With Quote
Old 15th September 2005, 15:23   #5
onad
Senior Member
 
onad's Avatar
 
Join Date: Dec 2004
Location: Turkey
Posts: 447
Lightbulb Multilingual example in Moreinfo plugin

Multilingual example in Moreinfo

Multilingual example in Moreinfo plugin. Multi language in an easy extensible way in one of the demos. Will solve a lot of multilanguage language problems.

The "CustomLanguageDemo" Fully shows the power of getting the OS GUI language. I the demo a good example of how custompage localization works and could be implemented.

See the Wikipage

http://nsis.sourceforge.net/wiki/MoreInfo_plug-in

Or take a look in:

http://forums.winamp.com/showthread...hlight=moreinfo

Just try the "CustomLanguageDemo" demo included.

"Just do it"
onad is offline   Reply With Quote
Old 16th September 2005, 08:01   #6
Beorne
Junior Member
 
Join Date: May 2004
Location: ITALY
Posts: 5
Quote:
Originally posted by glory_man
${ConfigRead} "configfile" "lang = " $R5
MessageBox MB_OK "Language - $R5"
StrCpy $LANGUAGE $R5

What does this MB show?
And attach script (if you can).

Function .onInit
${ConfigRead} "configfile" "lang = " $R5
StrCpy $LANGUAGE $R5
MessageBox MB_OK "Language - $LANGUAGE"
FunctionEnd

It shows me correcty "Language = Italian"
That is the value of the lang parameter

But the writings on the installer are not in Italian

If I put
MessageBox MB_OK "language2 = $LANGUAGE"
in another section, it shows me "language2 = 1033"

I don't wont to give different language options in the moment of the installation of the application. I'd like, at the moment of the compiling of the .nsi installer, to compile it with a languge set defined in a separate config file, like the effect obtained by using
LoadLanguageFile 'C:\Programmi\NSIS\Contrib\Language files\Italian.nlf'.
But I want to load a different language set on the basis of an external parameter.

I don'know if I have explained me well and I don't know if this is possible.
Beorne is offline   Reply With Quote
Old 16th September 2005, 10:04   #7
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
You need to use constant (like ${LANG_ENGLISH}, ${LANG_ITALIAN}, etc) or language ID (1033-for English, 1040-for italian, etc) to set right language.
glory_man 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