root / tmp / org.txm.setups / nsis-2.5 / Include / LangFile.nsh @ 3106
Historique | Voir | Annoter | Télécharger (2,74 ko)
1 | 2961 | mdecorde | /* |
---|---|---|---|
2 | 2961 | mdecorde | |
3 | 2961 | mdecorde | LangFile.nsh |
4 | 2961 | mdecorde | |
5 | 2961 | mdecorde | Header file to create langauge files that can be |
6 | 2961 | mdecorde | included with a single command. |
7 | 2961 | mdecorde | |
8 | 2961 | mdecorde | Copyright 2008-2015 Joost Verburg |
9 | 2961 | mdecorde | |
10 | 2961 | mdecorde | * Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT |
11 | 2961 | mdecorde | can be called from the script to include a language |
12 | 2961 | mdecorde | file. |
13 | 2961 | mdecorde | |
14 | 2961 | mdecorde | - LANGFILE_INCLUDE takes the language file name as parameter. |
15 | 2961 | mdecorde | - LANGFILE_INCLUDE_WITHDEFAULT takes as additional second |
16 | 2961 | mdecorde | parameter the default language file to load missing strings |
17 | 2961 | mdecorde | from. |
18 | 2961 | mdecorde | |
19 | 2961 | mdecorde | * A language file start with: |
20 | 2961 | mdecorde | !insertmacro LANGFILE_EXT "English" |
21 | 2961 | mdecorde | using the same name as the standard NSIS language file. |
22 | 2961 | mdecorde | |
23 | 2961 | mdecorde | * Language strings in the language file have the format: |
24 | 2961 | mdecorde | ${LangFileString} LANGSTRING_NAME "Text" |
25 | 2961 | mdecorde | |
26 | 2961 | mdecorde | */ |
27 | 2961 | mdecorde | |
28 | 2961 | mdecorde | !ifndef LANGFILE_INCLUDED |
29 | 2961 | mdecorde | !define LANGFILE_INCLUDED |
30 | 2961 | mdecorde | |
31 | 2961 | mdecorde | !macro LANGFILE_INCLUDE FILENAME |
32 | 2961 | mdecorde | |
33 | 2961 | mdecorde | ;Called from script: include a langauge file |
34 | 2961 | mdecorde | |
35 | 2961 | mdecorde | !ifdef LangFileString |
36 | 2961 | mdecorde | !undef LangFileString |
37 | 2961 | mdecorde | !endif |
38 | 2961 | mdecorde | |
39 | 2961 | mdecorde | !define LangFileString "!insertmacro LANGFILE_SETSTRING" |
40 | 2961 | mdecorde | |
41 | 2961 | mdecorde | !define LANGFILE_SETNAMES |
42 | 2961 | mdecorde | !include "${FILENAME}" |
43 | 2961 | mdecorde | !undef LANGFILE_SETNAMES |
44 | 2961 | mdecorde | |
45 | 2961 | mdecorde | ;Create language strings |
46 | 2961 | mdecorde | |
47 | 2961 | mdecorde | !undef LangFileString |
48 | 2961 | mdecorde | !define LangFileString "!insertmacro LANGFILE_LANGSTRING" |
49 | 2961 | mdecorde | !include "${FILENAME}" |
50 | 2961 | mdecorde | |
51 | 2961 | mdecorde | !macroend |
52 | 2961 | mdecorde | |
53 | 2961 | mdecorde | !macro LANGFILE_INCLUDE_WITHDEFAULT FILENAME FILENAME_DEFAULT |
54 | 2961 | mdecorde | |
55 | 2961 | mdecorde | ;Called from script: include a langauge file |
56 | 2961 | mdecorde | ;Obtains missing strings from a default file |
57 | 2961 | mdecorde | |
58 | 2961 | mdecorde | !ifdef LangFileString |
59 | 2961 | mdecorde | !undef LangFileString |
60 | 2961 | mdecorde | !endif |
61 | 2961 | mdecorde | |
62 | 2961 | mdecorde | !define LangFileString "!insertmacro LANGFILE_SETSTRING" |
63 | 2961 | mdecorde | |
64 | 2961 | mdecorde | !define LANGFILE_SETNAMES |
65 | 2961 | mdecorde | !include "${FILENAME}" |
66 | 2961 | mdecorde | !undef LANGFILE_SETNAMES |
67 | 2961 | mdecorde | |
68 | 2961 | mdecorde | ;Include default language for missing strings |
69 | 2961 | mdecorde | !include "${FILENAME_DEFAULT}" |
70 | 2961 | mdecorde | |
71 | 2961 | mdecorde | ;Create language strings |
72 | 2961 | mdecorde | !undef LangFileString |
73 | 2961 | mdecorde | !define LangFileString "!insertmacro LANGFILE_LANGSTRING" |
74 | 2961 | mdecorde | !include "${FILENAME_DEFAULT}" |
75 | 2961 | mdecorde | |
76 | 2961 | mdecorde | !macroend |
77 | 2961 | mdecorde | |
78 | 2961 | mdecorde | !macro LANGFILE IDNAME NAME |
79 | 2961 | mdecorde | |
80 | 2961 | mdecorde | ;Start of standard NSIS language file |
81 | 2961 | mdecorde | |
82 | 2961 | mdecorde | !ifdef LANGFILE_SETNAMES |
83 | 2961 | mdecorde | |
84 | 2961 | mdecorde | !ifdef LANGFILE_IDNAME |
85 | 2961 | mdecorde | !undef LANGFILE_IDNAME |
86 | 2961 | mdecorde | !endif |
87 | 2961 | mdecorde | |
88 | 2961 | mdecorde | !define LANGFILE_IDNAME "${IDNAME}" |
89 | 2961 | mdecorde | |
90 | 2961 | mdecorde | !ifndef "LANGFILE_${IDNAME}_NAME" |
91 | 2961 | mdecorde | !define "LANGFILE_${IDNAME}_NAME" "${NAME}" |
92 | 2961 | mdecorde | !endif |
93 | 2961 | mdecorde | |
94 | 2961 | mdecorde | !endif |
95 | 2961 | mdecorde | |
96 | 2961 | mdecorde | !macroend |
97 | 2961 | mdecorde | |
98 | 2961 | mdecorde | !macro LANGFILE_EXT IDNAME |
99 | 2961 | mdecorde | |
100 | 2961 | mdecorde | ;Start of installer language file |
101 | 2961 | mdecorde | |
102 | 2961 | mdecorde | !ifdef LANGFILE_SETNAMES |
103 | 2961 | mdecorde | |
104 | 2961 | mdecorde | !ifdef LANGFILE_IDNAME |
105 | 2961 | mdecorde | !undef LANGFILE_IDNAME |
106 | 2961 | mdecorde | !endif |
107 | 2961 | mdecorde | |
108 | 2961 | mdecorde | !define LANGFILE_IDNAME "${IDNAME}" |
109 | 2961 | mdecorde | |
110 | 2961 | mdecorde | !endif |
111 | 2961 | mdecorde | |
112 | 2961 | mdecorde | !macroend |
113 | 2961 | mdecorde | |
114 | 2961 | mdecorde | !macro LANGFILE_SETSTRING NAME VALUE |
115 | 2961 | mdecorde | |
116 | 2961 | mdecorde | ;Set define with translated string |
117 | 2961 | mdecorde | |
118 | 2961 | mdecorde | !ifndef ${NAME} |
119 | 2961 | mdecorde | !define "${NAME}" "${VALUE}" |
120 | 2961 | mdecorde | !endif |
121 | 2961 | mdecorde | |
122 | 2961 | mdecorde | !macroend |
123 | 2961 | mdecorde | |
124 | 2961 | mdecorde | !macro LANGFILE_LANGSTRING NAME DUMMY |
125 | 2961 | mdecorde | |
126 | 2961 | mdecorde | ;Create a language string from a define and undefine |
127 | 2961 | mdecorde | |
128 | 2961 | mdecorde | LangString "${NAME}" "${LANG_${LANGFILE_IDNAME}}" "${${NAME}}" |
129 | 2961 | mdecorde | !undef "${NAME}" |
130 | 2961 | mdecorde | |
131 | 2961 | mdecorde | !macroend |
132 | 2961 | mdecorde | |
133 | 2961 | mdecorde | !endif |