mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
adc618f6e7
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17366 a592a061-630c-0410-9148-cb99ea01b6c8
67 lines
1.4 KiB
Plaintext
67 lines
1.4 KiB
Plaintext
/*
|
|
|
|
Selection of language for LyX interface
|
|
|
|
*/
|
|
|
|
#--------------------------------
|
|
#Macros
|
|
|
|
!macro SetSystemLangItem VAR LANGNAME LANGISOCODE LANGID
|
|
|
|
${if} ${VAR} == ${LANGID}
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "State" "${LANGNAME}"
|
|
${endif}
|
|
|
|
!macroend
|
|
|
|
!macro SetSystemLang VAR
|
|
|
|
!insertmacro LanguageList '!insertmacro SetSystemLangItem ${VAR}'
|
|
|
|
!macroend
|
|
|
|
!macro GetISOLangCodeItem VAR_LANGNAME VAR_LANGISOCODE LANGNAME LANGISOCODE LANGID
|
|
|
|
${if} ${VAR_LANGNAME} == "${LANGNAME}"
|
|
StrCpy ${VAR_LANGISOCODE} "${LANGISOCODE}"
|
|
${endif}
|
|
|
|
!macroend
|
|
|
|
!macro GetISOLangCode VAR_LANGNAME VAR_LANGISOCODE
|
|
|
|
#Get the language code for the selected language name
|
|
|
|
!insertmacro LanguageList '!insertmacro GetISOLangCodeItem ${VAR_LANGNAME} ${VAR_LANGISOCODE}'
|
|
|
|
!macroend
|
|
|
|
#--------------------------------
|
|
#Functions
|
|
|
|
Function InitLanguage
|
|
|
|
#Set the default for the language selection dialog to the Windows language
|
|
|
|
System::Call "kernel32::GetUserDefaultUILanguage()i.R0"
|
|
!insertmacro SetSystemLang $R0
|
|
|
|
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"
|
|
!insertmacro GetISOLangCode $LangName $LangISOCode
|
|
|
|
FunctionEnd |