Translating R Manuals (and Messages)

UNDER THE CONSTUCTION NOW

edited by Chel Hee Lee <chl948@mail.usask.ca> on 2015-JUL-24.

The pilot project of translating R manuals is underway. This document is intended for translators listed in the R Manual section at http://translation.r-project.org. Note that the process for translating R manuals is basically identical to the process of translating R messages noted here.

  • How to work?
  • How to check translated version of manuals after submission?
  • Translation tips
  • How to Work?

    The following instructions for translating R messages and manuals are based on the Ubuntu Linux, and might be different for Mac or Windows users. But, most parts will be identical for all platforms. Since the manuals change with the develoment of R, this work is based on the most recent development version (R-devel). The instructions are written under the assumption that you are the member of the translate.R project hosted at the R-Forge.

    Step 1. Get the tools

    You need a subverison installed on your system. You also need a text editor such as Emacs or Geany. gedit is provided in Ubuntu by default. If you do not have, please use the following command:

    sudo apt-get install subversion geany poedit
    

    For Windows users, the practical guideline with TortoiseSVN is a good resource to start with. Also visit the website of TortoiseSVN.

    Step 2. Get files that you need to work

    If it is your first run, the following command allows you to have the source for manuals:
    $ svn checkout svn+ssh://[your.user.id]@r-forge.r-project.org/svnroot/translate-r/
    
    Note that [your.user.id] should be replaced by your user ID registered at R-Fore. Now consider that you are the volunteer who speaks Spanish and wishes to provide Spanish translation. Then, the portable objects for translator can be found as below:
    $ cd translate-r     # Enter the project directory
    $ svn update         # Update the project  
    $ cd src             # Enter the directory of keeping sources
    $ cd es              # Find your language
    $ cd man             # man = manuals, msg = messages
    $ ls
    R-admin-es.po  R-exts-es.po  R-intro-es.po  R-lang-es.po
    R-data-es.po   R-FAQ-es.po   R-ints-es.po   rw-FAQ-es.po
    
    The ISO 649 code for Spanish is es. Similarily, the portable objects for Japanese translation are located at the ./src/man/jp/.

    Step 3. Add or modify your translation

    Now, open R-intro-es.po file with one of text editors. Check over the head entries and make sure if the plural form for your language is correctly given. For the case of Spanish, the plural form is nplurals=2; plural=(n != 1);\n". More information about the plural form can be found at here.

    What you have to do from now is to fill in the msgstr entries corresponding to msgid.

    msgid "An Introduction to R"
    msgstr ""
    

    It is important that these match exactly in the msgid and msgstr lines: mismatches can cause translation to crash or nonsense on the output.

    msgid "An Introduction to R"
    msgstr "Una introducción a R"
    

    If you leave a translation as "" the untranslated message (msgid) will be used.

    If you are using Emacs, the PO mode help your translation. For more information, please see this page.

    For Windows users, a translation editor called poEdit is recommended for use.

    Step 4. Submit your translation

    Translation can be submitted by the following command:

    $ svn commit -m 'Translation is newly added to R-intro-es.po'
    

    How to check translated version of manuals after submission?

    Your translation submitted to R-Forge will be compiled at least once a day; thus, the output of your work will be up 12 or 24 hours after the submission. The output will be shown in the format of HTML from the following URL:

    http://translation.r-project.org/man/[doc_name]/[doc_name]-[language_code].html
    

    For example, you can check the R-intro manual translated in German by typing the following address:

    http://translation.r-project.org/man/R-intro/R-intro-de.html
    

    The process described here is identically applied to all other manuals.

    Translation Tips

    Fuzzy Translation

    Sometimes you will encounter a translation you know you have done for . First delete any fuzzy translation which has been generated, then use e.g.

    Plural Forms

    Some messages have plural forms, e.g.

      msgid        "Warning message:\n"
      msgid_plural "Warning messages:\n"
      msgstr[0]    ""
      msgstr[1]    ""
    

    The Plural-Forms: line tells you what these mean: in languages with just singular and one plural, the first is singular and the second is plural. For languages without plurals, just give one line starting msgstr[0]. Spanish would need for two lines.

    Glossary

    Note that translators may find it useful to consult the ISI glossary of statistical terms.