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> <para>
<emphasis>I hope I got all the places where changes are Language dependent resources reside in files
needed. If you see any place missing from the list, named <filename>somefile_Xx.rc</filename> or
submit a patch to this file please. Also note that <filename>Xx.rc</filename>, where <literal>Xx</literal>
re-organization of the source code might change the list of is your language abbreviation (look for it in
places.</emphasis> <filename>include/winnls.h</filename>). These are included
</para> in a master file named <filename>somefile.rc</filename> or
</note> <filename>rsrc.rc</filename>, located in the same
directory as the language files.
<para>
To add a new language you need to be able to translate the
relatively few texts, of course. You will need very little
knowledge of programming, so you have almost no excuses for
not adding your language, right? We should easily be able to
support 20 languages within a few months, get going! Apart
from re-compilation it'll take you about an hour or two.
</para>
<para>
To add a new language to the list of languages that Wine can
handle you must...
</para> </para>
<orderedlist>
<listitem>
<para> <para>
Find the language ID in To add a new language to one of these resources you
<filename>include/winnls.h</filename>. need to make a copy of the English resource (located
</para> in the <filename>somefile_En.rc</filename> file) over to
</listitem> your <filename>somefile_Xx.rc</filename> file, include this
<listitem> file in the master <filename>somefile.rc</filename> file,
<para> and edit the new file to translate the English text.
Look in <filename>ole/ole2nls.c</filename> if your You may also need to rearrange some of the controls
language is already incorporated in the <varname>static to better fit the newly translated strings. Test your changes
const struct NLS_langlocale</varname>. If not: find the to make sure they properly layout on the screen.
appropriate entries in
<filename>include/winnls.h</filename> and add them to the
list.
</para>
</listitem>
<listitem>
<para>
Edit the parameters defined in
<filename>ole/nls/*.nls</filename> to fit your local
habits and language.
</para>
</listitem>
<listitem>
<para>
Edit <filename>documentation/wine.man.in</filename>
(search for <parameter>-language</parameter>) to show the
new language abbreviation.
</para>
</listitem>
<listitem>
<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>
<para> <para>
In menus, the character "&amp;" means that the next In menus, the character "&amp;" means that the next
character will be highlighted and that pressing that character will be highlighted and that pressing that
letter will select the item. You should place these letter will select the item. You should place these
"&amp;" characters suitably for your language, not just "&amp;" characters suitably for your language, not just
copy the positions from (say) English. In particular, copy the positions from English. In particular,
items within one menu should have different highlighted items within one menu should have different highlighted
letters. letters.
</para> </para>
</listitem>
<listitem>
<para> <para>
Edit <filename>dlls/commdlg/rsrc.rc</filename> to contain To get a list of the files that need translating,
an <symbol>#include</symbol> statement for your run the following command in the root of your Wine tree:
<filename>cdlg_XX.rc</filename> file. <command>find -name "*En.rc"</command>.
</para> </para>
</listitem>
<listitem>
<para> <para>
Repeat steps 6 and 7 again for: When adding a new language, also make sure the parameters
<itemizedlist> defined in <filename>./dlls/kernel/nls/*.nls</filename>
<listitem> fit your local habits and language.
<para>
<filename>dlls/shell32/shell32_XX.rc</filename> and
<filename>shres.rc</filename>
</para> </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>