Web Site Translation
From Unofficial BOINC Wiki
BOINC has a mechanism for non-English translations of
- The BOINC Manager
- The BOINC-supplied portion of Project Web Sites (e.g. the account-creation pages)
- The project-specific parts of Project Web Sites
We encourage volunteers to do these translations. If you're interested, please see the instructions at the bottom of this page.
 Translation files
All translations are based on translation files. Translation files are in defined in the PO format. These have names like 'da.po' (Danish) and 'en.po' (English). It's very simple. For example:
 en.po (English)
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. "
 da.po (Danish)
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."
Each translation has a token CHARSET whose value should be the character set (e.g. iso-8859-1) used in the translation.
 Translatable Web Pages
Translatable web pages must be PHP, and must include
Literal text is replaced with tr(TOKEN), where TOKEN is a short string representing the text. For example,
is replaced with
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. 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 "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."
with the corresponding PHP:
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>" );
 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 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 a file called BOINC Manager.po. The release uses American English. Many other languages are available. The BOINC distribution includes all current language files.
 Instructions for Volunteer Translators
If you are interested in doing translation for BOINC or for a specific project:
- e-Mail the Translation Manager. For BOINC this is translate at boinc.berkeley.edu. Use this address also for SETI@Home translations. For other projects, contact the project.
- Obtain (typically via CVS) the 'authoritative' translation file. Typically this is en.po. The translation files for Project Web Sites are here.
- Create a translation file for your language. You can do this using a text editor or a specialized tool such as 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 boinc_loc email list defined at at ssl.berkeley.edu, which is devoted to discussion of BOINC-related translation.
- 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.
 UCB Source
 Copyright ©
- 2005 University of California
- 2005 Paul D. Buck
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.