Llynix
17th February 2005 04:39 UTC
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?
kichik
17th February 2005 18:48 UTC
Using Python, you can use:
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.
kichik
17th February 2005 20:02 UTC
Can you please include an example that crashes makensis? I can not reproduce this.
Llynix
18th February 2005 02:15 UTC
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.
kichik
18th February 2005 09:11 UTC
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.
Llynix
18th February 2005 15:44 UTC
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..
kichik
18th February 2005 15:53 UTC
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.
Llynix
19th February 2005 02:43 UTC
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