-
Notifications
You must be signed in to change notification settings - Fork 452
TranslateProject
A BOINC project web site consists of a "generic" part (provided by BOINC's PHP files) and a project-specific part (provided by the project).
Translation files for the generic part are kept in project_root/html/languages/translations. These files are installed when you create the project, and updated when you use upgrade. You can also copy them manually from boinc/html/languages/translations.
Translation files for the project-specific part should be kept in project_root/html/project/project_specific_translations. These files have names of the form es.po (es = Spanish).
When any translation file changes, you must run the script html/ops/update_translations.php for them to take effect on your web site. This script combines the generic and project-specific files into a single compiled version, e.g. html/languages/compiled/es.po.inc.
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"));
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."),
"<br>", "<a href=\"sah_email_form.php\">", "</a>",
"<p><img src=\"images/arrow_right.gif\">",
"<a href=create_account_form.php>", "</a>"
);
To generate a translation template (locale/templates/project.pot), edit the script html/ops/build_po.php so that it processes your project-specific PHP files, and run it from project_root/html.
At this point you can use whatever mechanism you want to create translations of your translation template.
The easiest way is to use the BOINC Translation Service, a web-based system that's used for BOINC itself and for Einstein@home. If you want to add your project, get in touch with the person responsible for the translation service by sending an email to the [email protected] email list.