Archive: Multilanguage "Browse for Folder" and cancel dialog


Multilanguage "Browse for Folder" and cancel dialog
Hi all,

I'm having a small problem with getting NSIS to display in a completely translated format...hopefully you guys can help a guy out!

Basically, I've setup the multilanguage environment correctly (I think!) and pretty much all the pages come out translated except for several buttons and window titles that always appear in English.

1) the "Browse for Folder" dialog:
- title of window is always "Browse for Folder"
- the buttons are always "Make New Folder", "OK", and "Cancel"

2) The "cancel installation" confirmation window:
- the buttons are always "Yes" and "No"

All other text in these windows and elsewhere in NSIS gets translated properly using the language files.

I've done some searching, both extensively in these forums and far and wide on the World's Wild Web and haven't found anything that seems to work...is there something obvious that I'm not defining? Like a MUI_REALLY_TRANSLATE_EVERYTHING_FOR_REAL_THIS_TIME definition? :cry:


i don't think that nsis translates these langstrings, as they are default in all windows. i'm always having a weird mixture of languages, as i'm using an english windows os with german settings (keyboard, locale..). if you got a similiar working environment, maybe test your installer on a computer with matching windows version and settings.


The text displayed there is based on which language Windows is in. So, even if your install is in Spanish it shows up there in English if Windows is English. You can change some of the text though yourself using DirText if you know the translations.


So I guess as far as easy modifications are concerned, I'm out of luck? But is there a more complicated solution? I'm fairly new to NSIS, and have only just started to explore the expanse of plugins available, but would anyone know of a replacement PlugIn(s) that could serve as the "Browse for Folder" and "Cancel" dialogs?

Obviously, they need to allow for replacement text and translations, or I'll be stuck with the same issues.

Failing the plug-in avenue, has no one else addressed this? I can't believe that I'm the only one who has to turn in projects with stringent translation policies!


MessageBoxEx can be used for the message boxes.


Did you try dialogs or dialogEx? See my signature.


On your suggestion I've been playing a bit with DialogEx, and I'm not sure it will do the trick. First of all, I'm not yet sure how to invoke it from the "Browse..." button on MUI_PAGE_DIRECTORY, but also, unless I'm missing something, I think it suffers from the same translation "problem"...the parameter list is as follows:

${ModernFolderBox} [Title] [Caption] [InitDir] [Return]

It provides a mechanism for changing the Title of Dialog, which DirText does not, but I haven't found a way to control the text on the buttons yet; they still read "Make New Folder", "ok", and "cancel"...


Those strings are from you PC..in my machine I get them translated...or you want them always translated?


Well, the "bug" that has been raised against my installer script is complaining that the button-text does not match the selected install-language.

So, yes, I'm trying to have those several buttons I mentioned always reflect the installer language....I don't want them to rely on the language of the windows distribution at all if possible.


According to MSDN, only on XP machines has that feature.


Ok, still working on a solution for the 'browse for folder' dialog, but using DrO's MessageBox plugin (http://forums.winamp.com/attachment....postid=1113028), here's my solution for the 'cancel dialog' (basically its been hacked together from several post, but I'm putting it here for anyone reading this that doesn't want to have to hack together one themselves...)

Replace "!define MUI_ABORTWARNING" with "!define MUI_CUSTOMFUNCTION_ABORT UserAbort"

New Function:

Function UserAbort
messagebox::show MB_ICONHAND|MB_DEFBUTTON2 "" "" "$(TEXT_ABORTWARNING_MSG)" "$(TEXT_YES_MSG)" "$(TEXT_NO_MSG)"
Pop $0
StrCmp $0 "2" 0 +2
Abort
FunctionEnd

LangString TEXT_YES_MSG ${LANG_ENGLISH} "Yes"
LangString TEXT_YES_MSG ${LANG_FRENCH} "Oui"

LangString TEXT_NO_MSG ${LANG_ENGLISH} "No"
LangString TEXT_NO_MSG ${LANG_FRENCH} "Non"

LangString TEXT_ABORTWARNING_MSG ${LANG_ENGLISH} "Are you sure you want to quit $(^Name) Setup?"
LangString TEXT_ABORTWARNING_MSG ${LANG_FRENCH} "Êtes-vous sûr de vouloir quitter l'installation de $(^Name) ?"