= Web and GUI translations =
BOINC has mechanisms for non-English translations of
* Parts of this site (the [/download.php Download] and [/poll.php BOINC user survey] pages, and related pages)
* The BOINC Manager
* Parts of the BOINC-supplied portion of project web sites
* The project-specific parts of project web sites
== Instructions for volunteer translators ==
Translations are done by volunteers. If you're interested in helping:
* Email the translation manager. For BOINC this is [[T(MailHide|tran...@boinc...|k=01LUzWNjTW63Fi-QRO2-H2ug==&c=hVi2Vhq36r0HGWxOKyVciRIHCa8ey_fi-teaby_UMcg=)]]. Use this address also for SETI@home translations. For other projects, contact the project.
* Obtain (typically via SVN) the 'authoritative' translation file. Usually this is en.po (English).
* Create a translation file for your language. You can do this using a text editor or a specialized tool such as [http://sourceforge.net/projects/poedit/ poedit].
* 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.
* Subscribe to the [mlist:boinc_loc boinc_loc] email list, which is for translation-related discussion and announcements.
* Because web sites are dynamic, you will have to periodically update your translation. You can do this efficiently by looking at the SVN diffs of the authoritative translation file.
== Translation files ==
Most translations are based on translation files. Translation files are in PO format, which is described [http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#SEC9 here]. These have names like `da.po` (Danish) and `en.po` (English). It's very simple. For example:
{{{
#!html
en.po (English)
}}}
{{{
msgid "Current version"
msgstr ""
msgid "%1 currently has the following applications. "
"When you participate in %2, 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."
msgstr ""
}}}
{{{
#!html
da.po (Danish)
}}}
{{{
msgid "Current version"
msgstr "Nuværende version"
msgid "%1 currently has the following applications. "
"When you participate in %2, 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."
msgstr "%1 har i øjeblikket følgende applikationer. "
"Når du deltager i %2 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."
}}}
Each translation has a token CHARSET whose value should be the character set used in the translation.
Please use UTF-8 if possible.
You can edit UTF-8 on Windows using [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++].
On Linux, you can use [http://www.vim.org/htmldoc/mbyte.html#UTF-8 vim].
{{{
#!comment Need to change this, all languages *should* use UTF-8 at least for the website side; other charsets cause problems. Existing translations have been converted already.
}}}
Here are links to the translation files for
* [source:trunk/boinc/languages/translations/ this web site]
* [source:trunk/boinc/html/languages/translations/ the BOINC-supplied part of project web sites]
* [source:trunk/boinc/locale/client/ the BOINC Manager]
== Writing translatable web pages ==
Translatable web pages must be PHP, and must include
{{{
require_once("../inc/translation.inc");
}}}
Literal text is replaced with `tra("text")`. For example,
{{{
page_head("Current version");
}}}
is replaced with
{{{
page_head(tra("Current version"));
}}}
For BOINC projects, the directory [source:trunk/boinc/html/languages/translations/ html/languages/translations] contains a number of 'translation files'. When a person accesses the page, the browser passes a list of languages. 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 `tr()` replaces the token with the corresponding translated text.
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
{{{
msgid "Already have an original 'Classic' account as of May 14, 2004?"
"%1We've transferred it, just %2activate it%3. "
"%4Otherwise %5create a new account%6."
msgstr ""
}}}
with the corresponding PHP:
{{{
printf(tra("Already have an original 'Classic' account as of May 14, 2004? %1We've transferred it, just %2activate it%3. %4Otherwise %5create a new account%6."),
"
", "", "",
"",
"", ""
);
}}}
== Project-specific translations ==
The web site of a BOINC-based project involves both
* BOINC pages, such as the forms for creating accounts. These are part of the BOINC source code distribution, and are updated periodically by BOINC.
* Project-specific pages (and BOINC pages that are modified by the project).
To allow translations of both types of pages, a project can haves its own 'project-specific translation files'. These are stored in a directory [source:trunk/boinc/html/user/project_specific_translations html/user/project_specific_translations]. Project-specific translation files override BOINC translation files.
== BOINC Manager translations ==
Menu names and other text in the BOINC manager are stored in files in [source:trunk/boinc/locale/client/ boinc/locale/client/].