mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 11:23:45 +00:00
d1a3055578
* use nsDialogs instead of InstallOptions for custom wizard pages, faster & easier to customize * upgrade to Modern UI 2 * use MultiUser.nsh to support multiple installation modes (all users / current user) in a much more simple way * use LangFile.nsh for the language files, again less scripting required * simplified installer structure * more meaningful variable names * more comments * minor fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24062 a592a061-630c-0410-9148-cb99ea01b6c8
78 lines
1.7 KiB
Plaintext
78 lines
1.7 KiB
Plaintext
/*
|
|
|
|
langselect.nsh
|
|
|
|
Selection of language for LyX interface
|
|
|
|
*/
|
|
|
|
Var LangSelectPage
|
|
Var LangSelectPage.Info
|
|
Var LangSelectPage.DropList
|
|
|
|
Var LangSystem
|
|
|
|
!macro LoadLang VAR LANGNAME LANGISOCODE LANGID
|
|
|
|
${NSD_CB_AddString} $LangSelectPage.DropList "${LANGNAME}"
|
|
|
|
!macroend
|
|
|
|
!macro SetSystemLang VAR LANGNAME LANGISOCODE LANGID
|
|
|
|
${If} ${VAR} == ${LANGID}
|
|
${NSD_CB_SelectString} $LangSelectPage.DropList "${LANGNAME}"
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
!macro GetISOLangCode VAR_LANGNAME VAR_LANGISOCODE LANGNAME LANGISOCODE LANGID
|
|
|
|
${If} ${VAR_LANGNAME} == "${LANGNAME}"
|
|
StrCpy ${VAR_LANGISOCODE} "${LANGISOCODE}"
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
# Page functions
|
|
|
|
Function PageLanguage
|
|
|
|
# Build the dialog
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(TEXT_LANGUAGE_TITLE)" "$(TEXT_LANGUAGE_SUBTITLE)"
|
|
|
|
nsDialogs::Create /NOUNLOAD 1018
|
|
Pop $LangSelectPage
|
|
|
|
${NSD_CreateLabel} 0u 0u 300u 20u $(TEXT_LANGUAGE_INFO)
|
|
Pop $LangSelectPage.Info
|
|
|
|
${NSD_CreateDropList} 0u 40u 110u 100u ""
|
|
Pop $LangSelectPage.DropList
|
|
|
|
# Load list of languages
|
|
!insertmacro Languages '!insertmacro LoadLang $LangSystem'
|
|
|
|
${If} $LangName == ""
|
|
# Set the default for the language selection dialog to the Windows language
|
|
System::Call "kernel32::GetUserDefaultUILanguage()i.s"
|
|
Pop $LangSystem
|
|
!insertmacro Languages '!insertmacro SetSystemLang $LangSystem'
|
|
${Else}
|
|
# Restore previous user selection
|
|
${NSD_CB_SelectString} $LangSelectPage.DropList $LangName
|
|
${EndIf}
|
|
|
|
nsDialogs::Show
|
|
|
|
FunctionEnd
|
|
|
|
Function PageLanguageValidate
|
|
|
|
${NSD_GetText} $LangSelectPage.DropList $LangName
|
|
# Convert to ISO code
|
|
!insertmacro Languages '!insertmacro GetISOLangCode $LangName $LangISOCode'
|
|
|
|
FunctionEnd
|