Archive: adding a custom langauge


adding a custom langauge
Hi,

Not found an answer to this in the archive or forum.

Is it possible to add further langauge files? Specifically I need to make an installer that has two english versions UK vs US along with French, German and Spanish.

The reason being that several properties of the aplication will be set depending upon which langauge is choosen. I.e. English (US) vs European (the others).

Having looked through much of the langauge support stuff I can't see a means to add lang_English_US or similar define. Is it possible or even advisable to do so? Does Nullsoft control the langauge ID's, or can new ones be added?

I can work around this by asking for user feedback during the instal, but if there was a simple way of duplicating the English lang.nif to provide a US version that would be useful.

Oh I should point out the UK and US language files will be exactly the same (copy & Paste), its just the ability to add Lang_English_US to the dropdown menu thats needed. As this would allow the installer to determine if this is a US or European install. Presumably requiring a unique lang ID.


English.nlf (lang id 1033) is English US
You could use 2057 for the new id i guess (English UK)

http://msdn.microsoft.com/library/de...l/nls_97vo.asp


thanks,

That makes sense, but i'm finding it difficult to determine where to start with this.

First off I guess i'd make a duplicate of English 1033 nlf, and re-assign the ID to 2057 (or whateever is appropriate. However i'm unclear how to get the two english options up in the langdll dialog box. Certinaly there are no defines in the source for that. Perhaps just adding a new nlf will automatically take care of it?

Then again somewhere there needs to be a define such as LANG_ENGLISH_US so that i can use that in NSIS, also I'd guess i'd want the options in the langdll dialog box to come up as English (UK) and English (US) otherwise there is little point in pursuing this direction.

Considering I could go the route of providing two checkboxes in the installer and get the user to select a region (US or European) I wonder if this is much more hassle than its worth? Also considering i've had limited experience with multilanguage applications in this way (things like codepages and lang ID's) perhaps its just better left alone?

I'd appriacte any further guideance you can offer.


First you need to duplicate also the English.nsh language file on the folder "NSIS\Contrib\Modern UI\Language Files". You need to change the .nsh by changing:

1) !insertmacro MUI_LANGUAGEFILE_BEGIN value to be equal to the file name without extention.

2) !define MUI_LANGNAME value depending on how you want the language to appear on the DropList.

To insert it in your script, use !insertmacro MUI_LANGUAGE ".nsh file name without extention". Now an extra item will appear on the DropList.


Thanks deguix, that worked great.

After following your advice and that of Anders I think i've got it all working as I need. I have only two issues remaining

1. Is it safe for me to adjust the english files (ID 1033) to be 'English (US)' for the langdll popup
2. Is there any relevance to ID 2057 - is that safe for me to use for 'English (UK)'

thanks again for your help, never expected this aspect to be so simple.


If you want to be sure, use the MakeLangID from your "NSIS\Bin" folder. This program was done from the Microsoft list of language ID's. To use it, select on the first droplist the primary language you're looking for (LANG_ENGLISH) then choose a sublanguage you want (SUBLANG_ENGLISH_UK). You'll see that the ID is 2057.

1. Is it safe for me to adjust the english files (ID 1033) to be 'English (US)' for the langdll popup
2. Is there any relevance to ID 2057 - is that safe for me to use for 'English (UK)'
They're safe to be changed. Just watch if there are any updates to the original English.nsh.

heh, i didnt know about the MakeLangID app :D


thanks,

Yeah I had a look at MakeLangID before, but I had assumed the sublang was like a subsitute lanagauge version to use of something - don't ask me why.

However after all the infromation in this thread it's clearer now. It would appear Anders was correct as it provides ID 2057 for UK Enlish.

Thanks for all your help