Changes between Version 2 and Version 3 of TranslateProject


Ignore:
Timestamp:
May 22, 2009, 2:08:58 PM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TranslateProject

    v2 v3  
    1 == Writing translatable web pages ==
     1= Web site translation =
     2
     3A BOINC project web site consists of a "generic" part (provided by BOINC's PHP files)
     4and a project-specific part (provided by the project).
     5
     6Translation files for the generic part are kept in
     7'''project_root/html/languages/translations'''.
     8These files are installed when you create the project,
     9and updated when you use [http://boinc.berkeley.edu/trac/wiki/ToolUpgrade upgrade].
     10You can also copy them manually from '''boinc/html/languages/translations'''.
     11
     12Translation files for the project-specific part should be kept in
     13'''project_root/html/project/project_specific_translations'''.
     14These files have names of the form '''es.po''' (es = Spanish).
     15
     16When any translation file changes, you must run the script
     17'''html/ops/update_translations.php'''
     18for them to take effect on your web site.
     19This script combines  the generic and project-specific files into
     20a single compiled version, e.g. '''html/languages/compiled/es.po.inc'''.
     21
     22== Making web pages translatable ==
    223
    324Translatable web pages must be PHP, and must include
    4 
    525{{{
    626require_once("../inc/translation.inc");
    727}}}
    8 
    928Literal text is replaced with `tra("text")`. For example,
    10 
    1129{{{
    1230page_head("Current version");
    1331}}}
    14 
    1532is replaced with
    16 
    1733{{{
    1834page_head(tra("Current version"));
    1935}}}
    2036
    21 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.
    22 
    23 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
     37Keep in mind that word order differs between languages,
     38so you should avoid breaking a sentence up into multiple translation units.
     39For example, use constructs like
    2440
    2541{{{
     
    4056}}}
    4157
    42 == Project-specific translations ==
     58== Generating a translation template ==
    4359
    44 The web site of a BOINC-based project involves both
     60To generate a translation template (en.po),
     61edit the script '''html/ops/build_po.php'''
     62so that it processes your project-specific PHP files,
     63and run it from project_root/html.
    4564
    46     * BOINC pages, such as the forms for creating accounts. These are part of the BOINC source code distribution, and are updated periodically by BOINC.
    47     * Project-specific pages (and BOINC pages that are modified by the project).
     65== Getting volunteers to do translations ==
    4866
    49 To allow translations of both types of pages, a project can have 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.
     67At this point you can use whatever mechanism you want to create translations of
     68your translation template.
     69
     70The easiest way is to use the
     71[TranslateIntro BOINC Translation Service],
     72a web-based system that's used for BOINC itself and for SETI@home.
     73To do this:
     74
     75 * Create a Subversion repository called '''locale''', with a subdirectory for each language.  This repository must be accessable by user '''boinc_trans'''.
     76 * Post a request to the [http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_loc boinc_loc@ssl.berkeley.edu] email list, asking that your project be added to the BOINC Translation Service.
     77
     78When this is set up, translations will automatically be checked into your locale/ repository.
     79You'll need to periodically update the working copy of this on your web server.
     80You'll also need to move translation files from, e.g., '''locale/es/web.po''' to '''project_root/html/project/project_specific_translations/es.po'''.
     81The easiest way to do this is to create a symbolic link from the latter to the former.