Skip to content
⌘ NSIS Forum Archive

custom localized string

8 posts

corneliu#

custom localized string

Hey everyone,

I have an uninstaller that shows a language pop-up and then shows another pop-up asking for user confirmation. How can I localize the message in the second pop-up according to the language chosen in the first pop-up? Here is the relevant piece of code:
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_YESNO "This will uninstall the application. Continue?" IDYES NoAbort
Abort
NoAbort:
FunctionEnd
Thank you in advance,

Corneliu
jpderuiter#
And create the Messagebox in un.onGUIInit
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
corneliu#
Thanks jpderuiter,

Way too complicated. I have settled for using the system locale which is good enough. No more language pop-up 🙂
MSG#
Please do not use the locale. Use the OS language instead.

Reason: Some people will have set their locale to a language different than their OS language. I create installers for translation patches of Japanese games, and these games often require a Japanese locale to run properly. But this doesn't mean the user actually wants to see the installer suddenly switching to Japanese...
corneliu#
Thank you MSG,

Here is my code. Does it use the locale or the language? I have no idea.

!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
LangString CONFIRM_MSG ${LANG_ENGLISH} "Blah, blah, blah. Continue?"
LangString CONFIRM_MSG ${LANG_FRENCH} "Blah, blah, blah. Voulez-vous continuer?"
Function un.onInit

MessageBox MB_YESNO "$(CONFIRM_MSG)" IDYES NoAbort
Abort
NoAbort:

FunctionEnd
MSG#
I dunno, I never use more than one language in my installers, but I seem to recall reading somewhere that NSIS uses OS language by default. But you can probably test it simply by setting your locale to something other than French. 🙂
corneliu#
Thanks MSG,

It's not worth the trouble. This is an internal software installer. We won't lose any customers over the language issue 🙂

Cheers,

Corneliu