How it works
require_once(\"../inc/translation.inc\");
tr(TOKEN)
,
where TOKEN is a short string representing the text.
For example,
page_head(\"Current version\");is replaced with
page_head(tr(APPS_VERSION));
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.\" |
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>\" );
The web site of a BOINC-based project involves both
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.
If you are interested in doing translation for BOINC or for a specific project: