Rewrite the i18n section.

oldstable
Dimitrie O. Paun 2003-09-22 19:34:48 +00:00 committed by Alexandre Julliard
parent 28036fd5dd
commit 0977813915
1 changed files with 43 additions and 189 deletions

View File

@ -4,203 +4,57 @@
<sect1 id="adding-languages"> <sect1 id="adding-languages">
<title>Adding New Languages</title> <title>Adding New Languages</title>
<para>
Written by &name-morten-welinder; <email>&email-morten-welinder;</email>,
January 1996.
</para>
<itemizedlist>
<listitem>
<para>
Thereafter revised February 1999 by Klaas van Gend
</para>
</listitem>
<listitem>
<para>
Revised again May 23, 1999, Klaas van Gend
</para>
</listitem>
<listitem>
<para>
Updated May 26, 2000, Zoran Dzelajlija
</para>
</listitem>
</itemizedlist>
<para>
(Extracted from <filename>wine/documentation/languages</filename>)
</para>
<para> <para>
This file documents the necessary procedure for adding a new This file documents the necessary procedure for adding a new
language to the list of languages that Wine can display system language to the list of languages that Wine can display system
menus and forms in. Currently at least the following languages menus and forms in. Adding new translations is not hard as
are still missing: it requires no programming knowledge or special skills.
<simplelist columns="5" type="horiz">
<member>Bulgarian</member>
<member>Chinese</member>
<member>Greek</member>
<member>Icelandic</member>
<member>Japanese</member>
<member>Romanian</member>
<member>Croatian</member>
<member>Slovak</member>
<member>Turkish</member>
<member>Slovanian</member>
</simplelist>
</para> </para>
<note>
<para>
<emphasis>I hope I got all the places where changes are
needed. If you see any place missing from the list,
submit a patch to this file please. Also note that
re-organization of the source code might change the list of
places.</emphasis>
</para>
</note>
<para> <para>
To add a new language you need to be able to translate the Language dependent resources reside in files
relatively few texts, of course. You will need very little named <filename>somefile_Xx.rc</filename> or
knowledge of programming, so you have almost no excuses for <filename>Xx.rc</filename>, where <literal>Xx</literal>
not adding your language, right? We should easily be able to is your language abbreviation (look for it in
support 20 languages within a few months, get going! Apart <filename>include/winnls.h</filename>). These are included
from re-compilation it'll take you about an hour or two. in a master file named <filename>somefile.rc</filename> or
</para> <filename>rsrc.rc</filename>, located in the same
<para> directory as the language files.
To add a new language to the list of languages that Wine can
handle you must...
</para> </para>
<orderedlist> <para>
<listitem> To add a new language to one of these resources you
<para> need to make a copy of the English resource (located
Find the language ID in in the <filename>somefile_En.rc</filename> file) over to
<filename>include/winnls.h</filename>. your <filename>somefile_Xx.rc</filename> file, include this
</para> file in the master <filename>somefile.rc</filename> file,
</listitem> and edit the new file to translate the English text.
<listitem> You may also need to rearrange some of the controls
<para> to better fit the newly translated strings. Test your changes
Look in <filename>ole/ole2nls.c</filename> if your to make sure they properly layout on the screen.
language is already incorporated in the <varname>static </para>
const struct NLS_langlocale</varname>. If not: find the
appropriate entries in <para>
<filename>include/winnls.h</filename> and add them to the In menus, the character "&amp;" means that the next
list. character will be highlighted and that pressing that
</para> letter will select the item. You should place these
</listitem> "&amp;" characters suitably for your language, not just
<listitem> copy the positions from English. In particular,
<para> items within one menu should have different highlighted
Edit the parameters defined in letters.
<filename>ole/nls/*.nls</filename> to fit your local </para>
habits and language.
</para> <para>
</listitem> To get a list of the files that need translating,
<listitem> run the following command in the root of your Wine tree:
<para> <command>find -name "*En.rc"</command>.
Edit <filename>documentation/wine.man.in</filename> </para>
(search for <parameter>-language</parameter>) to show the
new language abbreviation. <para>
</para> When adding a new language, also make sure the parameters
</listitem> defined in <filename>./dlls/kernel/nls/*.nls</filename>
<listitem> fit your local habits and language.
<para> </para>
Edit <filename>misc/main.c</filename> variable
<varname>Languages</varname> to contain the new language
abbreviation and language ID. Also edit
<structname>struct option_table</structname> in
<filename>misc/options.c</filename> to show the new
abbreviation.
</para>
</listitem>
<listitem>
<para>
Edit <filename>include/options.h</filename>
<type>enum</type> <varname>WINE_LANGUAGE</varname> to have
a member called <literal>LANG_XX</literal> where
<literal>XX</literal> is the new abbreviation.
</para>
</listitem>
<listitem>
<para>
Create a new file
<filename>dlls/commdlg/cdlg_XX.rc</filename> (where
<literal>XX</literal> is your language abbreviation)
containing all menus. Your best bet is to copy
<filename>cdlg_En.rc</filename> and start translating.
There is no real need to know how the internal structure
of the file, as you only need to translate the text within
quotes.
</para>
<para>
In menus, the character "&amp;" means that the next
character will be highlighted and that pressing that
letter will select the item. You should place these
"&amp;" characters suitably for your language, not just
copy the positions from (say) English. In particular,
items within one menu should have different highlighted
letters.
</para>
</listitem>
<listitem>
<para>
Edit <filename>dlls/commdlg/rsrc.rc</filename> to contain
an <symbol>#include</symbol> statement for your
<filename>cdlg_XX.rc</filename> file.
</para>
</listitem>
<listitem>
<para>
Repeat steps 6 and 7 again for:
<itemizedlist>
<listitem>
<para>
<filename>dlls/shell32/shell32_XX.rc</filename> and
<filename>shres.rc</filename>
</para>
</listitem>
<listitem>
<para>
<filename>resources/sysres_XX.rc</filename> and
<filename>user32.rc</filename>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>
Re-configure, re-make dependencies, and re-make Wine.
</para>
</listitem>
<listitem>
<para>
Check your new menus and forms; when they're not ok, go
back to 6) and adapt the sizes, etc.
</para>
</listitem>
<listitem>
<para>
Several of the winelib based programs in the subdirectory
programs also have internationalization support. See the
appropriate files there for reference.
</para>
</listitem>
<listitem>
<para>
Edit <filename>documentation/internationalization</filename>
to show the new status.
</para>
</listitem>
<listitem>
<para>
Submit patches for inclusion in the next Wine release, see
file <filename>./ANNOUNCE</filename> for details about
where to submit.
</para>
</listitem>
</orderedlist>
</sect1> </sect1>
</chapter> </chapter>