Archive: Select Language


Select Language
Hi folks,

I want to use the selection which I get from MUI_LANGUAGE and copy a file if selected language is e.g. German.
Could someone tell me, how I achieve it?

Here my code which is not functioning:

!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "English"

!if ${LANGUAGE} == "German"
CopyFiles "$INSTDIR\ipsone_de.qm" "$INSTDIR\ipsone_default.qm"
!endif

Hope someone can help me!

Greets


Try to use logiclib:

${if} ${LANGUAGE} == ${LANG_ENGLISH}
...action...


Thanks.

but what do you mean with logiclib?

I have tried this, but it doesn't worked:
!if ${LANGUAGE} == ${LANG_GERMAN}
CopyFiles "$INSTDIR\ipsone_de.qm" "$INSTDIR\ipsone_default.qm"

Greets


TIP

Since nsis 2.16 there is no specific use for letting the user choose the language for the installer, since the installer takes the GUI language of the OS and takes the exact language for the installer, if not embeeted in the installer, takes the close match, otherwise the default language.

The philosphy:
If one can USE the OS one can sure read that language. there is much more to this, it is a complex subject. Plz read the Wiki for more info.


Hi!

Yes, I understand, but there are many users, which have a system in english and natively speak an other language...
Nevertheless I need an information what language the user applies. How do I get this language information?
My intention is to copy a certain file if a certain language is selected at installation. Just as I mentioned in the previous messages.

Greets


the correct use with LogicLib is like this:

!include LogicLib.nsh

function CheckLang
${if} $LANGUAGE == ${LANG_GREEK}
messagebox mb_ok 'your choice is greek'
${ElseIf} $LANGUAGE == ${LANG_ENGLISH}
messagebox mb_ok 'your choice is english'
${EndIf}
functionend

you may also want to take a look at included example
${NSISDIR}\Examples\Languages.nsi


Strike!
Thanks for your help! That's what I've been looking for.
Greets ipsoner