找到你要的答案

Q:How to set a default language on select language dialog?

Q:如何在选择语言对话框上设置默认语言?

I have my .nis like this:

## Languages (first language is the default language)
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Dutch"

I read the manual and it says:

first language is the default language

If I don't use English that works correctly, if I use English that is always the default language:

How I can change the default language?

我有我的。NIS这样:

## Languages (第一语言是默认语言)
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Dutch"

我读了说明书,上面写着:

第一语言是默认语言

如果我不使用正确的英语,如果我使用的英语永远是默认语言:

如何更改默认语言?

answer1: 回答1:

There are 3 steps involved in selecting the default language for the language picker dialog.

  1. At startup NSIS tries to initialize $Language with the language id of the UI language the user is using. This happens before the .onInit callback is called.
  2. If you are using the MUI and have set the MUI_LANGDLL_REGISTRY_* defines and they are found in the registry then $Language is forced to that language in the MUI_LANGDLL_DISPLAY macro. Remove the defines if you don't want this behavior or define MUI_LANGDLL_ALWAYSSHOW to let the user override it.
  3. The LangDLL plugin will filter out some of the languages if it thinks there is a codepage problem (in ANSI installers). This can be turned off by defining MUI_LANGDLL_ALLLANGUAGES.

If you want to ignore step 1 then you have to force the language on your own:

Function .onInit
    StrCpy $Language ${LANG_FRENCH}
    !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

有3个步骤选择语言选择器对话框的默认语言。

  1. At startup NSIS tries to initialize $Language with the language id of the UI language the user is using. This happens before the .onInit callback is called.
  2. If you are using the MUI and have set the MUI_LANGDLL_REGISTRY_* defines and they are found in the registry then $Language is forced to that language in the MUI_LANGDLL_DISPLAY macro. Remove the defines if you don't want this behavior or define MUI_LANGDLL_ALWAYSSHOW to let the user override it.
  3. The LangDLL plugin will filter out some of the languages if it thinks there is a codepage problem (in ANSI installers). This can be turned off by defining MUI_LANGDLL_ALLLANGUAGES.

如果你想忽略步骤1,那么你必须强迫自己的语言:

Function .onInit
    StrCpy $Language ${LANG_FRENCH}
    !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
nsis  multilanguage