Old 17th February 2005, 04:39   #1
Llynix
Junior Member
 
Join Date: Nov 2004
Posts: 32
Send a message via AIM to Llynix
Localization of installer.

I'm trying to provide translations for messags inside my installer. So far I've had good sucess mostly, but somehow I'm not referencing these correctly or something.

Installer: http://wiki.worldwindcentral.com/World_Wind_Eta_Full_b1

And my translations (which I put in a Global.nsh file included in the installer.)

http://wiki.worldwindcentral.com/Installer_Translations

problem is when I save this file as ASCII, I lose the polish chars, and when I save as UTF-8 it crashes NSIS.

Any suggestions?
Llynix is offline   Reply With Quote
Old 17th February 2005, 18:48   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Using Python, you can use:
code:
f = codecs.open("utf.txt", "r", "utf-8")
t = f.read()
f.close()
t = t.lstrip(unicode(codecs.BOM_UTF8,"utf-8"))
f = open("1250.txt", w)
f.write(t.encode("CP1250"))
f.close()

It's surely possible with many other tools too.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 17th February 2005, 20:02   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Can you please include an example that crashes makensis? I can not reproduce this.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 18th February 2005, 02:15   #4
Llynix
Junior Member
 
Join Date: Nov 2004
Posts: 32
Send a message via AIM to Llynix
If I encode in anything but ASCII the file does not compile. It causes an error in line one. If I save it as ASCII it seems to work, however I'm having a problem with the fact that it's always using the English translations (all other languages are ignored.)

Sigh.. I'm also having problems with the line

StrCpy $1 ".NET 1.1"$(Requirement1)

It's empty every time

This hasn't been my week.

Anthony Taylor (Llynix)
NASA World Wind Installer Maintainer
Llynix is offline   Reply With Quote
Old 18th February 2005, 09:11   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Not being able to compile a script is not crashing.

Your StrCpy line has the quotes misplaced. Put the ending quote after the language string. The way you wrote it, $(Requirement1) specifies the maximum number of characters to copy from ".NET 1.1" into $1. Since it's a string with no numbers, it'll be translated to 0 and you'll always get an empty string.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 18th February 2005, 15:44   #6
Llynix
Junior Member
 
Join Date: Nov 2004
Posts: 32
Send a message via AIM to Llynix
Ahh.. I had worked around the problem with two strCpy's

strCpy $0 ".NET 1.1"
strCpy $1 $0$(Requirement1)

I think your solution is more elegant though, I was unaware you could reference strings inside strings.

Now the only problem I'm having is that the english is getting used regardless. For a test I feed all the defined strings into messagebox's and change the language, but no love.

I'll update the wiki to the latest Installer I'm using. Perhaps someone here can figure it out..
Llynix is offline   Reply With Quote
Old 18th February 2005, 15:53   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
That's because, eventhough $LANGUAGE is changed in .onInit, it only takes affect after .onInit. You can put the message itself in .onGUIInit. I'd even do the check before asking the user for a language. No sense in letting the user down after the hard work of selecting the language

One problem with .onGUIInit is that it won't be called in silent mode. So you have to check for silent mode in .onInit and abort if it's on.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th February 2005, 02:43   #8
Llynix
Junior Member
 
Join Date: Nov 2004
Posts: 32
Send a message via AIM to Llynix
Thank you kichik, your explanation and another thread about the same problem got it all solved. I now have multiple languages Just not quite sure what any of them say. hehe

Anthony Taylor (Llynix)
NASA World Wind Installer Maintainer
Llynix 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