2006-07-12 11:03:00 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Selection of language for LyX interface
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Macros
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!macro SetSystemLangItem VAR LANGNAME LANGISOCODE LANGID
|
2006-07-12 11:03:00 +00:00
|
|
|
|
2006-10-21 22:53:19 +00:00
|
|
|
${if} ${VAR} == ${LANGID}
|
2006-10-02 17:21:20 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "State" "${LANGNAME}"
|
2006-07-12 11:03:00 +00:00
|
|
|
${endif}
|
|
|
|
|
|
|
|
!macroend
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!macro SetSystemLang VAR
|
2006-07-12 11:03:00 +00:00
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!insertmacro LanguageList '!insertmacro SetSystemLangItem ${VAR}'
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
!macroend
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!macro GetISOLangCodeItem VAR_LANGNAME VAR_LANGISOCODE LANGNAME LANGISOCODE LANGID
|
|
|
|
|
|
|
|
${if} ${VAR_LANGNAME} == "${LANGNAME}"
|
|
|
|
StrCpy ${VAR_LANGISOCODE} "${LANGISOCODE}"
|
|
|
|
${endif}
|
2006-07-12 11:03:00 +00:00
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro GetISOLangCode VAR_LANGNAME VAR_LANGISOCODE
|
|
|
|
|
|
|
|
;Get the language code for the selected language name
|
|
|
|
|
|
|
|
!insertmacro LanguageList '!insertmacro GetISOLangCodeItem ${VAR_LANGNAME} ${VAR_LANGISOCODE}'
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Functions
|
|
|
|
|
|
|
|
Function InitLanguage
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
;Set the default for the language selection dialog to the Windows language
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
System::Call "kernel32::GetUserDefaultUILanguage()i.R0"
|
2006-10-02 17:21:20 +00:00
|
|
|
!insertmacro SetSystemLang $R0
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Page functions
|
|
|
|
|
|
|
|
Function PageLanguage
|
|
|
|
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(TEXT_LANGUAGE_TITLE)" "$(TEXT_LANGUAGE_SUBTITLE)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "langselect.ini"
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function PageLanguageValidate
|
|
|
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_READ $LangName "langselect.ini" "Field 2" "State"
|
2006-10-02 17:21:20 +00:00
|
|
|
!insertmacro GetISOLangCode $LangName $LangISOCode
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
FunctionEnd
|