Fix unreachable TVHT_ONITEMSTATEICON in TREEVIEW_LButtonDown.
[wine] / documentation / i18n.sgml
1   <chapter id="i18n">
2     <title>Internationalization</title>
3
4     <sect1 id="adding-languages">
5       <title>Adding New Languages</title>
6
7       <para>
8         Written by &name-morten-welinder; <email>&email-morten-welinder;</email>,
9         January 1996.
10       </para>
11
12       <itemizedlist>
13         <listitem>
14           <para>
15             Thereafter revised February 1999 by Klaas van Gend
16           </para>
17         </listitem>
18         <listitem>
19           <para>
20             Revised again May 23, 1999, Klaas van Gend
21           </para>
22         </listitem>
23         <listitem>
24           <para>
25             Updated May 26, 2000, Zoran Dzelajlija
26           </para>
27         </listitem>
28       </itemizedlist>
29
30       <para>
31         (Extracted from <filename>wine/documentation/languages</filename>)
32       </para>
33
34       <para>
35         This file documents the necessary procedure for adding a new
36         language to the list of languages that Wine can display system
37         menus and forms in. Currently at least the following languages
38         are still missing:
39         <simplelist columns="5" type="horiz">
40           <member>Bulgarian</member>
41           <member>Chinese</member>
42           <member>Greek</member>
43           <member>Icelandic</member>
44           <member>Japanese</member>
45           <member>Romanian</member>
46           <member>Croatian</member>
47           <member>Slovak</member>
48           <member>Turkish</member>
49           <member>Slovanian</member>
50         </simplelist>
51       </para>
52
53       <note>
54         <para>
55           <emphasis>I hope I got all the places where changes are
56             needed.  If you see any place missing from the list,
57             submit a patch to this file please. Also note that
58             re-organization of the source code might change the list of
59             places.</emphasis>
60         </para>
61       </note>
62
63       <para>
64         To add a new language you need to be able to translate the
65         relatively few texts, of course.  You will need very little
66         knowledge of programming, so you have almost no excuses for
67         not adding your language, right?  We should easily be able to
68         support 20 languages within a few months, get going!  Apart
69         from re-compilation it'll take you about an hour or two.
70       </para>
71       <para>
72         To add a new language to the list of languages that Wine can
73         handle you must...
74       </para>
75
76       <orderedlist>
77         <listitem>
78           <para>
79             Find the language ID in
80             <filename>include/winnls.h</filename>.
81           </para>
82         </listitem>
83         <listitem>
84           <para>
85             Look in <filename>ole/ole2nls.c</filename> if your
86             language is already incorporated in the <varname>static
87               const struct NLS_langlocale</varname>. If not: find the
88             appropriate entries in
89             <filename>include/winnls.h</filename> and add them to the
90             list.
91           </para>
92         </listitem>
93         <listitem>
94           <para>
95             Edit the parameters defined in
96             <filename>ole/nls/*.nls</filename> to fit your local
97             habits and language.
98           </para>
99         </listitem>
100         <listitem>
101           <para>
102             Edit <filename>documentation/wine.man.in</filename>
103             (search for <parameter>-language</parameter>) to show the
104             new language abbreviation.
105           </para>
106         </listitem>
107         <listitem>
108           <para>
109             Edit <filename>misc/main.c</filename> variable
110             <varname>Languages</varname> to contain the new language
111             abbreviation and language ID.  Also edit
112             <structname>struct option_table</structname> in
113             <filename>misc/options.c</filename> to show the new
114             abbreviation.
115           </para>
116         </listitem>
117         <listitem>
118           <para>
119             Edit <filename>include/options.h</filename>
120             <type>enum</type> <varname>WINE_LANGUAGE</varname> to have
121             a member called <literal>LANG_XX</literal> where
122             <literal>XX</literal> is the new abbreviation.
123           </para>
124         </listitem>
125         <listitem>
126           <para>
127             Create a new file
128             <filename>dlls/commdlg/cdlg_XX.rc</filename> (where
129             <literal>XX</literal> is your language  abbreviation)
130             containing all menus. Your best bet is to copy
131             <filename>cdlg_En.rc</filename> and start translating.
132             There is no real need to know how the internal structure
133             of the file, as you only need to translate the text within
134             quotes. 
135           </para>
136           <para>
137             In menus, the character "&amp;" means that the next
138             character will be highlighted and that pressing that
139             letter will select the item. You should place these
140             "&amp;" characters suitably for your language, not just
141             copy the positions from (say) English.  In particular,
142             items within one menu should have different highlighted
143             letters.
144           </para>
145         </listitem>
146         <listitem>
147           <para>
148             Edit <filename>dlls/commdlg/rsrc.rc</filename> to contain
149             an <symbol>#include</symbol> statement for your
150             <filename>cdlg_XX.rc</filename> file.
151           </para>
152         </listitem>
153         <listitem>
154           <para>
155             Repeat steps 6 and 7 again for:
156             <itemizedlist>
157               <listitem>
158                 <para>
159                   <filename>dlls/shell32/shell32_XX.rc</filename> and
160                   <filename>shres.rc</filename>
161                 </para>
162               </listitem>
163               <listitem>
164                 <para>
165                   <filename>resources/sysres_XX.rc</filename> and
166                   <filename>user32.rc</filename>
167                 </para>
168               </listitem>
169             </itemizedlist>
170           </para>
171         </listitem>
172         <listitem>
173           <para>
174             Re-configure, re-make dependencies, and re-make Wine.
175           </para>
176         </listitem>
177         <listitem>
178           <para>
179             Check your new menus and forms; when they're not ok, go
180             back to 6) and adapt the sizes, etc.
181           </para>
182         </listitem>
183         <listitem>
184           <para>
185             Several of the winelib based programs in the subdirectory
186             programs also have internationalization support. See the
187             appropriate files there for reference.
188           </para>
189         </listitem>
190         <listitem>
191           <para>
192             Edit <filename>documentation/internationalization</filename>
193             to show the new status.
194           </para>
195         </listitem>
196         <listitem>
197           <para>
198             Submit patches for inclusion in the next Wine release, see
199             file <filename>./ANNOUNCE</filename> for details about
200             where to submit.
201           </para>
202         </listitem>
203       </orderedlist>
204     </sect1>
205   </chapter>
206
207 <!-- Keep this comment at the end of the file
208 Local variables:
209 mode: sgml
210 sgml-parent-document:("wine-devel.sgml" "set" "book" "part" "chapter" "")
211 End:
212 -->