Archive: MUI and MultiLanguage


MUI and MultiLanguage
As it happens, my first NSIS/MUI project has to be a MultiLanguage project. With the examples provided the first steps were real easy.

One thing annoyed me though: The language of the language selection dialog is always English. As the installer at this time already knows the language of the local system, it should be possible to set the four strings in the dialog to that language.

After some thought I found out that this is easy to do for the title and the info. I simply put the definition for these strings into the respective language file, e.g. for German

!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_LANGDLL_WINDOWTITLE "Sprache der Installation"
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_LANGDLL_INFO "Bitte wählen Sie eine Sprache."

Unfortunately I found no obvious method to set the captions of the buttons "OK" and "Cancel", too.

Any suggestions how I should approach this problem? I believe that there is quite a number of people out there who could profit if the solution would be integrated into the NSIS/MUI standard.

Peter


This is not currently possible. If you know C, you can modify the source code and provide us with a patch.


I did follow your advice, and it actually works. Hopefully you can accept the changes the way I make them available here (based on MUI version 1.63, but IMHO it should be possible to integrate the changes into the current development version without effort).


Thank you for your patch. I appreciate your effort but I will not integrate it yet because of the following reasons:

If that change is already made, then making the dialog language change on selection would be a lot better. Using your method might cause installers to show the dialog using languages that people might not understand. If, for example, I will use this on my Hebrew system with an installer that has French, German and English in it, and the first language used is French, I won't understand a thing. It can also present problems when the computer's language doesn't match the user's language (public computers for example). English is a universal language and was therefore used.

A smaller, but still important problem is that both ways mentioned would require updating all of the language files, again. Are you aware that third of the languages have still not been updated to the latest version? Some language files are even stuck in an even older version for several months :(

Therefore, this change will probably be done after NSIS 2 is released. NSIS 2 has been held back long enough.


kichik,

I understand that you do not want to integrate the changes at this time, of cause. But I would like a few words in answer to your statements, anyway:

Regarding e.g. a Hebrew system: I thought that NSIS reverts to the default language, namely English, when the computer's language is not available among the language files. On a Hebrew system the language selection dialog should thus display English strings.

When you do not want the computer's language to be used for the dialog, though a respective language file is available, isn't it possible to overrule the language recognition by setting in my script the language variable for the language that I prefer?

Concerning the update of language files: I left the defines (MUI_TEXT_LANGDLL_WINDOWTITLE and so on) with English strings in the macro definition MUI_LANGDLL_DISPLAY of system.nsh precisely for this reason. As long as a particular language file does not yet contain the additional four macro lines, the English strings will be used.


NSIS does revert to the default language, but in the case I presented above it's the French language because it's the first one.

The script can't overrule the language inside .onInit, and even if it could, I see no possible way to detect a user that wants another language than the default for any reason. If the language would change according to his selection then the user will have a chance to let the installer know what language he'd like to see. Otherwise, we might be forcing him to a language s/he might not understand. English, in this case, is a safe assumption.

Empty strings are not the problem, it's the fact that they will be in English. We don't want to release half ready language files.