Archive: Who know how to get the current pc language setting by NSIS script?


Who know how to get the current pc language setting by NSIS script?
Dear all,

Any expert on NSIS script?

I am doing an installation package by NSIS,But Now I fall across a problem.
I want to make the installation package display the language matched with my pc "setting ->control panel->Regional and language options->regional options" language settings.
Now ,I don't know how to get the pc "setting ->control panel->Regional and language options->regional options" language settings by NSIS,Anyone know it ,Any methods ?
If I can get my loacal language settings,then I can $LANGUAGE to be the local language.

I am anxious about your help.


Thanks&Regards,
Janice


http://forums.winamp.com/showthread.php?t=252680 - GetSystemDefaultLangID

From some further googling..
http://www.google.com/search?q=site%...rDefaultLangID
..it seems that it should already be using the user's language?
http://forums.winamp.com/archive/ind.../t-259017.html


Long ago NSIS used the regional settings to determine default installer language. Now it uses the host OS UI language instead.

air_circle, please don't set your installer to the regional language. PLEASE. It is a common occurrence to have your Windows set to a locale you don't really want to use. Example: My PCs are all in Japanese locale because the translation projects I work on (often) require it. But that doesn't mean I can read Japanese myself. I do NOT want installers to suddenly switch to Japanese, just because my locale happens to be set to Japanese.

The way NSIS behaves is the proper way. If you must set the default to the locale language, please at least show a selection screen before you start the installer.


Dear Animaether&MSG,

Thanks for your info ,Now I want to NSIS installation package only display English whatever the OS is which language,How can I do it? Can anyone know the implement of macro "MUI_LANGUAGE" ,because I find some code example have following setting,can anyone explain what is done if execute following code.And which langugage is setted?
# Installer languages
!insertmacro MUI_LANGUAGE "English" ;
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"

Thanks&Regards,
Janice


To make an English-only installer, simply remove all language macros except English.


Dear MSG,

I remember you said that NSIS uses the host OS UI language to determine default installer language,If my os is chinese,only keep english micro there ok? But NSIS installater shall not display chinese first according to my os language chinese.I am confused ,can you explain the truth to me?

As I understand,I think I shall set $LANGUAGE is english as follwoing code here.Why you don't refer this,is this not needed? Whether I have misunderstand?
Function .onInit
#!insertmacro MUI_LANGDLL_DISPLAY
StrCpy $LANGUAGE ${LANG_ENGLISH}
FunctionEnd

Thanks.


If you only include the English macro, then you're not adding Chinese as an installer language, and naturally your installer will not show in Chinese in that case.

As for your second question, I never use languages in NSIS, all my installers are only in English. So I have no idea. I'm sure it's in the (MUI2) documentation somewhere.