Archive: creating a Japanese installer


creating a Japanese installer
Ok,

So for text that is already in the installer i dont have to do anything. But for custom text i have hit a brick wall.

Obviously these need to be put into a lang string, and the file then has to be saved as unicode or UTF-8. However the nsis compiler wont use this as it has the majic 'im a utf-8' file markers at the start.

So given this, is there a way to put custom Japanese characters into an installer?

thanks

Steve


Seeing as how the Japanese language file included uses Shift-JIS, I would think you have to save your custom text as Shift-JIS.

However, I don't think it will work on a system that doesn't have SJIS as its default codepage - at least, it doesn't work on my Danish XP, despite having Japanese fonts and all that installed. It just shows up as the raw SJIS text.

I've attached a sample script that opens a yes/no dialog box with the word "TESUTO" (SJIS: ƒeƒXƒg) in it, using the Japanese language file. It doesn't really do anything, but you can at least tell if it's possible on your machine.

On a related note, it would be nice if it was possible to change the charset used by NSIS in the script.


Thanks a lot for your help, im trying to get through this at the moment, and its taking me an age, and is quite frustrating.... So thanks.

I didnt realise you needed to use LoadLanguageFile, not sure what that does really? Ive just been defining japanese as a language using !insertmacro MUI_LANGUAGE "Japanese", maybe that does the same thing?

Ive tried out your example code, and on my machine UK win XP, it looks like the printed message, however when i tried it on a Japanese windows (still compiled on mine) it looks like Japanese (No idea what it means though). So assuming the text it displayed is correct, how did you get the japanese chars to be like the ones in your script?

any help would be greatly appreciated.


LoadLanguageFile is the old way of doing it, and IIRC, the only way for the "classic" UI. If you go to Examples\Modern UI, you can try the MultiLanguage example for Japanese in Modern UI (which, for the record, does the same thing as classic UI - displays raw SJIS on non-Japanese Windows).

The reason it won't work on your UK XP is most likely because NSIS installers are set to use the default character set. Since the default character set on the system is ISO-8859-1/Windows-1252 (unlike a Japanese system, where they use Shift-JIS by default), Windows will treat it as plain text on the UK system since it doesn't know that it needs to decode the text.

To actually use it, you need to open the file in a text editor supporting Shift-JIS, enter the Japanese text, and finally save it in the proper format (SJIS). You can use one of several editors, such as Word or JWPce, or most other editors. To save a little time, you can take your current UTF-8 file and open it in JWPce, then save it as SJIS.


if that is the case, does that mean that i wont be able to have say japanese and another language?


I think i might have figured out whats going on here.... maybe (youll have to forgive my lack of knowlage with regards this, first time ive had to do anything like it).

So using JWPce (thanks for the link) i can create the langString statements then save these out in a Shift-JIS file. If i then open this with notepad and paste this into an NSIS script, i can use japanese chars (well at least it appears to be working, please let me know if im setting myself up for a fall though).

Do you know if an NSIS script can be made to include text from another file (like a jsp include from a web page) to avoid me having to do this copy and paste?

thanks for your help

Steve


You can open the NSIS script in JWPce and type it there. When done, select Save As and choose Shift-JIS as the filetype. Then, save on top of the .nsi script (alternatively, save as .sjs and rename to .nsi).

BTW, you are able to have several languages in one file regardless. You just won't get the Japanese characters shown correctly on computers that don't use Shift-JIS.