2005-03-05 23:12:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("docutil.php");
|
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
page_head("Web and GUI translations");
|
2005-03-05 23:12:31 +00:00
|
|
|
|
|
|
|
echo "
|
2005-03-22 05:30:32 +00:00
|
|
|
BOINC has a mechanism for non-English translations of
|
|
|
|
<ul>
|
|
|
|
<li> The BOINC Manager
|
|
|
|
<li> The BOINC-supplied portion of project web sites
|
|
|
|
(e.g. the account-creation pages)
|
|
|
|
<li> The project-specific parts of project web sites
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
We encourage volunteers to do these translations.
|
|
|
|
If you're interested, please see the instructions at the bottom of this page.
|
2005-03-05 23:12:31 +00:00
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
<h2>Translation files</h2>
|
2005-03-05 23:12:31 +00:00
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
<p>
|
|
|
|
All translations are based on <b>translation files</b>.
|
2005-03-05 23:12:31 +00:00
|
|
|
Translation files are in PO format, which
|
|
|
|
is described
|
|
|
|
<a href=http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#SEC9>here</a>.
|
2005-03-22 05:30:32 +00:00
|
|
|
These have names like 'da.po' (Danish) and 'en.po' (English).
|
|
|
|
It's very simple.
|
|
|
|
For example:
|
2005-03-05 23:12:31 +00:00
|
|
|
<table>
|
|
|
|
<tr><th>en.po (English)</th></tr>
|
|
|
|
<tr><td>
|
|
|
|
<pre>
|
|
|
|
msgid \"APPS_VERSION\"
|
|
|
|
msgstr \"Current version\"
|
|
|
|
|
|
|
|
msgid \"APPS_DESCRIPTION\"
|
|
|
|
msgstr \"\$PROJECT currently has the following applications. \"
|
|
|
|
\"When you participate in \$PROJECT, work for one or more \"
|
|
|
|
\"of these applications will be assigned to your computer. \"
|
|
|
|
\"The current version of the application will be downloaded \"
|
|
|
|
\"to your computer. This happens automatically; you don't have to do anything. \"
|
|
|
|
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</td></tr>
|
|
|
|
<tr><th>da.po (Danish)</th></tr>
|
|
|
|
<tr><td>
|
|
|
|
<pre>
|
|
|
|
msgid \"APPS_VERSION\"
|
|
|
|
msgstr \"Nuværende version\"
|
|
|
|
|
|
|
|
msgid \"APPS_DESCRIPTION\"
|
|
|
|
msgstr \"\$PROJECT har i øjeblikket følgende applikationer. \"
|
|
|
|
\"Når du deltager i \$PROJECT vil arbejde fra en eller flere \"
|
|
|
|
\"af disse applikationer blive tildelt din computer. \"
|
|
|
|
\"Den nuværende version af applikationen vil blive downloadet \"
|
|
|
|
\"til din computer. Dette sker automatisk - du behøver ikke at gøre noget.\"
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</td></tr></table>
|
|
|
|
Each translation has a token CHARSET whose value should be
|
|
|
|
the character set (e.g. iso-8859-1) used in the translation.
|
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
|
|
|
|
<h2>Translatable web pages</h2>
|
|
|
|
Translatable web pages must be PHP, and must include
|
|
|
|
<pre>
|
|
|
|
require_once(\"../inc/translation.inc\");
|
|
|
|
</pre>
|
|
|
|
Literal text is replaced with <code>tr(TOKEN)</code>,
|
|
|
|
where TOKEN is a short string representing the text.
|
|
|
|
For example,
|
|
|
|
<pre>
|
|
|
|
page_head(\"Current version\");
|
|
|
|
</pre>
|
|
|
|
is replaced with
|
|
|
|
<pre>
|
|
|
|
page_head(tr(APPS_VERSION));
|
|
|
|
</pre>
|
|
|
|
For BOINC projects,
|
|
|
|
the directory html/user/translations contains a number of
|
|
|
|
'translation files'.
|
|
|
|
When a person accesses the page, the browser passes a list of languages.
|
2005-03-05 23:12:31 +00:00
|
|
|
The BOINC PHP code finds the first of these languages for which
|
|
|
|
a translation is available, or English if none.
|
|
|
|
As the page is generated, each call to <code>tr()</code>
|
|
|
|
replaces the token with the corresponding translated text.
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
In developing web pages, keep in mind that word
|
|
|
|
order differs between languages,
|
|
|
|
so you should avoid breaking a sentence up into
|
|
|
|
multiple translation units.
|
|
|
|
For example, use constructs like
|
|
|
|
<pre>
|
|
|
|
msgid \"ACTIVATE_OR_CREATE\"
|
|
|
|
msgstr \"Already have an original 'Classic' account as of May 14, 2004? \"
|
|
|
|
\"<br>We've transferred it, just %sactivate it%s. \"
|
|
|
|
\"%sOtherwise %screate a new account%s.\"
|
|
|
|
</pre>
|
|
|
|
with the corresponding PHP:
|
|
|
|
<pre>
|
|
|
|
printf(tr(ACTIVATE_OR_CREATE),
|
|
|
|
\"<a href=sah_email_form.php>\", \"</a>\",
|
|
|
|
\"<p><img border=0 src=images/arrow_right.gif width=9 height=7>\",
|
|
|
|
\"<a href=create_account_form.php>\", \"</a>\"
|
|
|
|
);
|
|
|
|
</pre>
|
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
<h2>Project-specific translations</h2>
|
2005-03-05 23:12:31 +00:00
|
|
|
<p>
|
|
|
|
The web site of a BOINC-based project involves both
|
|
|
|
<ul>
|
|
|
|
<li> BOINC pages, such as the forms for creating accounts.
|
|
|
|
These are part of the BOINC source code distribution,
|
|
|
|
and are updated periodically by BOINC.
|
|
|
|
<li> Project-specific pages (and BOINC pages that
|
|
|
|
are modified by the project).
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
To allow translations of both types of pages,
|
|
|
|
a project can haves its own
|
|
|
|
'project-specific translation files'.
|
|
|
|
These are stored in a directory html/user/project_specific_translations.
|
|
|
|
Project-specific translation files override BOINC translation files.
|
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
<h2>BOINC Manager translations</h2>
|
|
|
|
<p>
|
|
|
|
Menu names and other text in the BOINC manager are stored in
|
|
|
|
a file called <b>BOINC Manager.po</b>.
|
|
|
|
The release uses American English.
|
|
|
|
Many other languages are available.
|
|
|
|
The BOINC distribution includes all current language files.
|
|
|
|
|
|
|
|
<h2>Instructions for volunteer translators</h2>
|
2005-03-05 23:12:31 +00:00
|
|
|
<p>
|
|
|
|
If you are interested in doing translation for BOINC or
|
|
|
|
for a specific project:
|
|
|
|
|
|
|
|
<ul>
|
2005-03-22 05:30:32 +00:00
|
|
|
<li> Email the translation manager.
|
|
|
|
For BOINC this is <b>translate at boinc.berkeley.edu</b>.
|
|
|
|
Use this address also for SETI@home translations.
|
2005-03-05 23:12:31 +00:00
|
|
|
For other projects, contact the project.
|
|
|
|
<li>
|
|
|
|
Obtain (typically via CVS) the 'authoritative' translation file.
|
|
|
|
Typically this is en.po.
|
2005-03-22 05:30:32 +00:00
|
|
|
The translation files for project web sites are
|
2005-03-05 23:12:31 +00:00
|
|
|
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/boinc/html/languages/translations/>here</a>.
|
|
|
|
<li>
|
|
|
|
Create a translation file for your language.
|
|
|
|
You can do this using a text editor or a specialized tool such as
|
|
|
|
<a href=http://www.poedit.org/>poedit</a>.
|
2005-03-22 05:30:32 +00:00
|
|
|
<li>
|
2005-03-05 23:12:31 +00:00
|
|
|
Send this to the translation manager,
|
|
|
|
who will then install it on the project's web site.
|
|
|
|
Check all relevant pages and fix as needed.
|
2005-03-22 05:30:32 +00:00
|
|
|
<li>
|
|
|
|
Subscribe to the
|
|
|
|
<a href=http://ssl.berkeley.edu/mailman/listinfo/boinc_loc>boinc_loc at ssl.berkeley.edu</a>
|
|
|
|
email list, which is devoted to discussion of BOINC-related translation.
|
|
|
|
|
2005-03-05 23:12:31 +00:00
|
|
|
<li>
|
|
|
|
Because web sites are dynamic,
|
|
|
|
you will have to periodically update your translation.
|
|
|
|
You can do this efficiently by looking at the CVS diffs
|
|
|
|
of the authoritative translation file.
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|