Archive: Please allow other languages


Please allow other languages
NSIS now allows to specify most of the texts that appear in dialogs, but not all of them. I think, it would be very usefull for lot of people to be able to localize NSIS without the need to modify NSIS sources (i.e. just by instructions in NSIS script). For the first run (when I forget texts in details view that can be disabled by "ShowInstDetails nevershow"), it would be sufficient to allow the localization of ten (eleven) texts, mostly butons and the specification of the font (or font script: Western, Central European, Hebrew, Baltic, Greece etc.) for the background window.

Here are the hardcoded texts:

Buttons:
-------
I Agree
< Back
Next >
Cancel
Browse...
Install
Uninstall
Close
Show details - only because of current behaviour, see bellow

Other texts:
------------
Space required
Space available

Would it be usefull for other users?

By the way, "ShowInstDetails nevershow" is working only in Installer, not in Unisntaller - I can't get rid of "Show details" button in Uninstaller.


At this time, translating NSIS needs to edit the source (which is, of course, easy to get). I am actually translating v1.57 (I know 1.59 is out, but I will not restart again) in French, after I put Edgewise extensions into it.

Progress status :
MakeNSIS: 100 %
Zip2Exe: 100 %
Documentation : 12 %
Scripts : 0 %


Repzilon,

localization of source files has two disadvantages:

1) New versions of NSIS come very often and you have to repeat your work over and over again because language specific texts are not gathered in one place.

2) Only a programmer with Visual C++ can do this.


But, it was until recently that Justin had been working hard on NSIS. AND, some of the fixes are just minor (not with 1.59), and it is very easy to convert over. Sometimes it has just minor coding fixes and it is very very very easy to convert over.

Now, if you have some versions of NSIS and you want to help out other developers, then submit them to the NSIS Project House!!!!!

-Duane


Perhaps if you asked Justin extremely nicely and did all the updating for him so he only had to sync. his copy of the source code with the one you supplied, he would make all the texts in resources and files a #define in a file like 'language.h' .. ?


Better solution - runtime string loading. Probably with a new optional .NSI directive for language pack files.

I will come up with a very generic low-overhead solution for this tonight. I'm bored but not tired :)

-- Edgewize


ok i've compiled a german version of nsis but its VERY ugly

because the strings (like agree) are directly on the
items

it would be much better to use variables and to have these variables in a special file

then it would be much easier to change the lang. ans perhaps to
make lang.xml files


Try this to get rid of the ShowDetails in the unistall
Section "Uninstall"
SetDetailsView "nevershow"

I would personally like a japanese version of it.


Edgewize, do you mean updating the string list resource of the exe header when 'makingnsis' or storing the strings in the code at the end of the final exe file ?

I was thinking if the text was set to something really obscure like 'NSISSTRINGCODE001' in the exe file in non unicode, as long as these were defined as say 256 character arrays when the makensis is run, it could search in the exe header and update these texts with no fear of buffer overrun.


Right now I have MakeNSIS add the localized strings to the internal string table with pre-defined ID numbers, and then the EXE header extracts them before running .onInit and uses them instead of the default english strings.

It's a little bit kludgy, though, since it doesn't translate any of the loading error messages or the Verifying Executable... window (for large installers).

An alternative is to teach MakeNSIS how to update a Windows EXE resource section (its pretty easy) and then have it replace all the strings inside of EXEHEAD. (EXEHEAD would also need to use LoadString to get all its text from the resource file.)

I like the second approach better, so I've started work on that in my spare time. I'll integrate it into 1.60 when the final version comes out and send it to Justin.


mail me if you need any help.


not that I was for a moment proposing you were incapable.. just offering.. :)


Thanks for the offer :) I've got this one covered, though. I once did something like it for my own program so I have a great example to work off.


DOH!
Hah, Justin beat me to it :p

Check out the example .NSH files in NSIS 1.60beta2


Great, Justin!

International versions of NSIS installers can be made easily now.

To be perfect, two details are missing:

1) ability to specify font and character set for the background window text (now Garamond, ANSI_CHARSET)
2) one hardcoded text left out: "verifying installer x%" (I mention this only for completeness - this is not so important, user notices this text only in big installers loaded from slower media)

Thank you!


The Verifying... text is displayed before the EXE has been parsed and the string table loaded, so it might not be possible using the current method.


ok i'm happy .

now i can include my favorite button texts
in my nsi file
(with help from the samples included in the 1.6 beta)
this works fine, i dont need to recompile my nsis on every new version that out

only one thing is left :
the details are in english, so :

please allow to change the copying and so in there to be changed too !!!!


Another problem
With these header files, the error messages are not translated unfortunately. So, there is some source to translate left.