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