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 "
|
2007-02-16 05:04:08 +00:00
|
|
|
BOINC has mechanisms for non-English translations of
|
2005-03-22 05:30:32 +00:00
|
|
|
<ul>
|
2006-08-08 20:32:37 +00:00
|
|
|
<li> Parts of this site (the <a href=download.php>Download</a>
|
|
|
|
and <a href=poll.php>BOINC user survey</a> pages,
|
|
|
|
and related pages)
|
2005-03-22 05:30:32 +00:00
|
|
|
<li> The BOINC Manager
|
2006-08-08 16:38:28 +00:00
|
|
|
<li> Parts of the BOINC-supplied portion of project web sites
|
2005-03-22 05:30:32 +00:00
|
|
|
<li> The project-specific parts of project web sites
|
|
|
|
</ul>
|
2006-08-08 20:32:37 +00:00
|
|
|
|
|
|
|
<h2>Instructions for volunteer translators</h2>
|
2005-03-22 05:30:32 +00:00
|
|
|
<p>
|
2006-08-08 20:32:37 +00:00
|
|
|
Translations are done by volunteers.
|
|
|
|
If you're interested in helping:
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li> Email the translation manager.
|
|
|
|
For BOINC this is <b>translate at boinc.berkeley.edu</b>.
|
|
|
|
Use this address also for SETI@home translations.
|
|
|
|
For other projects, contact the project.
|
|
|
|
<li>
|
|
|
|
Obtain (typically via CVS) the 'authoritative' translation file.
|
|
|
|
Usually this is en.po (English).
|
|
|
|
<li>
|
|
|
|
Create a translation file for your language.
|
|
|
|
You can do this using a text editor or a specialized tool such as
|
2007-01-26 18:38:17 +00:00
|
|
|
<a href=http://sourceforge.net/projects/poedit/>poedit</a>.
|
2006-08-08 20:32:37 +00:00
|
|
|
<li>
|
|
|
|
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.
|
|
|
|
<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 for translation-related discussion and announcements.
|
|
|
|
|
|
|
|
<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>
|
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>
|
2007-02-16 05:04:08 +00:00
|
|
|
Most 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:
|
2006-08-08 20:32:37 +00:00
|
|
|
<table width=100%>
|
2005-03-05 23:12:31 +00:00
|
|
|
<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.
|
|
|
|
|
2006-08-08 16:38:28 +00:00
|
|
|
<p>
|
|
|
|
Here are links to the translation files for
|
|
|
|
<ul>
|
2007-04-17 17:12:44 +00:00
|
|
|
<li> <a href=http://boinc.berkeley.edu/trac/browser/trunk/boinc/languages/translations/>this web site</a>
|
2007-04-24 23:21:42 +00:00
|
|
|
<li> <a href=http://boinc.berkeley.edu/trac/browser/trunk/boinc/html/languages/translations/>the BOINC-supplied part of project web sites</a>.
|
2007-04-17 17:12:44 +00:00
|
|
|
<li> <a href=http://boinc.berkeley.edu/trac/browser/trunk/boinc/locale/client/>the BOINC Manager</a>.
|
2006-08-08 16:38:28 +00:00
|
|
|
</ul>
|
|
|
|
|
2005-03-22 05:30:32 +00:00
|
|
|
|
2007-02-16 05:04:08 +00:00
|
|
|
<h2>Writing translatable web pages</h2>
|
2005-03-22 05:30:32 +00:00
|
|
|
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,
|
2007-02-16 05:04:08 +00:00
|
|
|
the directory html/languages/translations contains a number of
|
2005-03-22 05:30:32 +00:00
|
|
|
'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>
|
2006-08-08 20:32:37 +00:00
|
|
|
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.
|
2005-03-05 23:12:31 +00:00
|
|
|
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
|
2006-08-08 20:32:37 +00:00
|
|
|
files in <b>boinc/locale/client/</b>.
|
2005-03-05 23:12:31 +00:00
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|