ipsoner
12th May 2006 12:49 UTC
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
glory_man
12th May 2006 13:41 UTC
Try to use logiclib:
${if} ${LANGUAGE} == ${LANG_ENGLISH}
...action...
ipsoner
12th May 2006 14:23 UTC
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
onad
12th May 2006 15:15 UTC
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.
ipsoner
14th May 2006 17:19 UTC
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
Red Wine
14th May 2006 17:36 UTC
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
ipsoner
14th May 2006 20:25 UTC
Strike!
Thanks for your help! That's what I've been looking for.
Greets ipsoner