sintonia/campcaster/doc/studioLocalization.html

89 lines
3.9 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Campcaster documentation for LS Studio localization</title>
<meta content="$Author$" name="author">
</head>
<body>
<h1>Preface</h1>
This document is part of the <a href="http://campcaster.campware.org/">Campcaster</a>
project, Copyright © 2004 <a href="http://www.mdlf.org/">Media
Development Loan Fund</a>, under the GNU <a
href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
<ul>
<li>Author: $Author$</li>
<li>Version: $Revision$</li>
<li>Location: $URL$</li>
</ul>
<h1>Scope</h1>
This document describes the process of adding a new language to the
Campcaster Studio localization. It is written for developers.<br>
<h1>Introduction</h1>
Campcaster Studio (a.k.a. the C++ GUI) uses IBM's
<a href="http://www-306.ibm.com/software/globalization/icu/index.jsp">ICU</a>
library for localization. This library supports a fallback mechanism:
if the locale is set to <b>es_GT</b> (Guatemalan Spanish), it first tries to
read the <b>es_GT</b> table for localized strings; if there is no such table,
it tries the <b>es</b> table; and if that is missing, too, it reads the
<b>root</b> table.<br>
These tables are stored as UTF-8 text files (with Unix line breaks, i.e., a
single 0x0A character at the end of each line) in the
<code>products/gLiveSupport/var</code> directory with a <code>txt</code>
extension: e.g., <code>es_GT.txt</code>.
Before these files can be used by the program, they need to be converted into
binary <i>resource bundle</i> files using ICU's <code>genrb</code> program
(which is in <code>usr/bin</code>, and is called by the Makefile).
<h1>Modifying an existing language</h1>
<ul>
<li>Edit the text file (e.g.,
<code>products/gLiveSupport/var/es_GT.txt</code>).</li>
<li>Run <code>make</code> in <code>products/gLiveSupport</code>.</li>
</ul>
<h1>Adding a new language</h1>
<ul>
<li>Add the new text file to <code>products/gLiveSupport/var</code>.
(See the
<a href="http://icu.sourceforge.net/userguide/localizing.html#ICU4C">ICU
user guide</a> for the format of this file.)<br>
The first row of the file should be the locale name, followed by
":table". The locale name is of the form
<code>&lt;language-code&gt;[[_&lt;country-code&gt;]_&lt;variant&gt;]</code>,
where
<ul>
<li><code>&lt;language-code&gt;</code> is the
<a href="http://www.loc.gov/standards/iso639-2/langcodes.html">ISO 639-1</a>
2-letter language code in lowercase,</li>
<li>the optional <code>&lt;country-code&gt;</code> is the
<a href="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1</a>
2-letter country code in uppercase, and</li>
<li>the optional <code>&lt;variant&gt;</code> is the variant
(usually EURO or CYRILLIC) in uppercase.</li>
</ul>
Note that this is slightly different from the normal ISO standard:
ICU uses it_IT_EURO where the standard would be it_IT@euro.<br>
Make sure the file is in UTF-8 encoding, has Unix line breaks,
and does not have a
<a href="http://www.unicode.org/faq/utf_bom.html#BOM">BOM</a>
character at the beginning.<br>
The file name should be the locale name, followed by ".txt".
<li>Add a new line for the new language in each of the files
<ul>
<li><code>campcaster-studio.xml</code></li>
<li><code>campcaster-studio.xml.template</code></li>
<li><code>campcaster-studio.xml.user-template</code></li>
<li><code>Makefile.in</code></li>
</ul>
in the <code>products/gLiveSupport/etc</code> directory.</li>
<li>Run <code>configure --prefix=...</code> and then
<code>make clean all</code>
in the <code>products/gLiveSupport</code> directory.
</ul>
<br>
</body>
</html>