]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/components/langselect.nsh
Change windows installer comments from ; to #
[lyx.git] / development / Win32 / packaging / installer / components / langselect.nsh
1 /*
2
3 Selection of language for LyX interface
4
5 */
6
7 #--------------------------------
8 #Macros
9
10 !macro SetSystemLangItem VAR LANGNAME LANGISOCODE LANGID
11
12   ${if} ${VAR} == ${LANGID}
13     !insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "State" "${LANGNAME}"
14   ${endif}
15
16 !macroend
17
18 !macro SetSystemLang VAR
19
20   !insertmacro LanguageList '!insertmacro SetSystemLangItem ${VAR}'
21   
22 !macroend
23
24 !macro GetISOLangCodeItem VAR_LANGNAME VAR_LANGISOCODE LANGNAME LANGISOCODE LANGID
25
26   ${if} ${VAR_LANGNAME} == "${LANGNAME}"
27     StrCpy ${VAR_LANGISOCODE} "${LANGISOCODE}"
28   ${endif}
29   
30 !macroend
31
32 !macro GetISOLangCode VAR_LANGNAME VAR_LANGISOCODE
33
34   #Get the language code for the selected language name
35
36   !insertmacro LanguageList '!insertmacro GetISOLangCodeItem ${VAR_LANGNAME} ${VAR_LANGISOCODE}'
37
38 !macroend
39
40 #--------------------------------
41 #Functions
42
43 Function InitLanguage
44
45   #Set the default for the language selection dialog to the Windows language
46
47   System::Call "kernel32::GetUserDefaultUILanguage()i.R0"
48   !insertmacro SetSystemLang $R0
49   
50 FunctionEnd
51
52 #--------------------------------
53 #Page functions
54
55 Function PageLanguage
56
57   !insertmacro MUI_HEADER_TEXT "$(TEXT_LANGUAGE_TITLE)" "$(TEXT_LANGUAGE_SUBTITLE)"
58   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "langselect.ini"
59  
60 FunctionEnd
61
62 Function PageLanguageValidate
63
64   !insertmacro MUI_INSTALLOPTIONS_READ $LangName "langselect.ini" "Field 2" "State"
65   !insertmacro GetISOLangCode $LangName $LangISOCode
66   
67 FunctionEnd