From ripley at stats.ox.ac.uk  Thu Jun 21 22:56:16 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 21 Jun 2007 21:56:16 +0100 (BST)
Subject: [Rd] Basic Question on error(_(...
In-Reply-To: <467AE18B.2000604@biostat.ku.dk>
References: <20070621201152.GA6013@bjl> <467AE18B.2000604@biostat.ku.dk>
Message-ID: <Pine.LNX.4.64.0706212150100.26695@gannet.stats.ox.ac.uk>

On Thu, 21 Jun 2007, Peter Dalgaard wrote:

> statmobile at gmail.com wrote:
>> I'm sorry to bother this list with such trivial questions, but I'm
>> trying to take Prof. Ripley's advice in porting some Lapack wrappers
>> into my own code, because they are not public.  I'm specifically
>> choosing programs from R-2.5.0/src/modules/lapack/Lapack.c.
>>
>> I can't seem to understand the context in functions such as:
>>
>> <snip>
>>         error(_("the leading minor of order %d is not positive
>>         definite"),
>>               i);
>> </snip>
>>
>> in functions such as modLa_chol.  Is there some place I can look to
>> understand the usage of the underscore '_', or could someone explain
>> this to me?
>>
> This has to do with internationalization. It signifies that translations
> are available for the error message, e.g. the file "de.po" in the R
> sources has
>
> #: src/modules/lapack/Lapack.c:629
> #, c-format
> msgid "the leading minor of order %d is not positive definite"
> msgstr "der f?hrende Minor der Ordnung %d ist nicht positiv definit"

The answer to 'where' is section 1.9 Localization in 'Writing R 
Extensions' or section 3.1 of 'R Internals'.



-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Basic Question on error(_(...
Prof Brian Ripley