The R Project SVN R

Rev

Rev 88098 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88098 Rev 89707
Line 1... Line 1...
1
% File src/library/base/man/gettext.Rd
1
% File src/library/base/man/gettext.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2025 R Core Team
3
% Copyright 1995-2026 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{gettext}
6
\name{gettext}
7
\title{Translate Text Messages}
7
\title{Translate Text Messages}
8
\alias{gettext}
8
\alias{gettext}
Line 31... Line 31...
31
}
31
}
32
\arguments{
32
\arguments{
33
  \item{\dots}{one or more character vectors.}
33
  \item{\dots}{one or more character vectors.}
34
  \item{trim}{logical indicating if the white space trimming in
34
  \item{trim}{logical indicating if the white space trimming in
35
    \code{gettext()} should happen.  \code{trim = FALSE} may be needed for
35
    \code{gettext()} should happen.  \code{trim = FALSE} may be needed for
36
    compiled code (C / C++) messages which often end with \code{\\n}.}
36
    compiled code (C / C++) messages which often end with \samp{\n}.}
37
  \item{domain}{the \sQuote{domain} for the translation, a \code{character}
37
  \item{domain}{the \sQuote{domain} for the translation, a \code{character}
38
    string, or \code{\link{NULL}}; see \sQuote{Details}.}
38
    string, or \code{\link{NULL}}; see \sQuote{Details}.}
39
  \item{n}{a non-negative integer.}
39
  \item{n}{a non-negative integer.}
40
  \item{msg1}{the message to be used in English for \code{n = 1}.}
40
  \item{msg1}{the message to be used in English for \code{n = 1}.}
41
  \item{msg2}{the message to be used in English for \code{n = 0, 2, 3, \dots}.}
41
  \item{msg2}{the message to be used in English for \code{n = 0, 2, 3, \dots}.}
Line 81... Line 81...
81
  Conventionally the domain for \R warning/error messages in package
81
  Conventionally the domain for \R warning/error messages in package
82
  \pkg{pkg} is \code{"R-pkg"}, and that for C-level messages is \code{"pkg"}.
82
  \pkg{pkg} is \code{"R-pkg"}, and that for C-level messages is \code{"pkg"}.
83
 
83
 
84
  For \code{gettext}, when \code{trim} is true as by default,
84
  For \code{gettext}, when \code{trim} is true as by default,
85
  leading and trailing whitespace is ignored (\dQuote{trimmed}) when
85
  leading and trailing whitespace is ignored (\dQuote{trimmed}) when
86
  looking for the translation.
86
  looking for the translation.  R-level message catalogues from
-
 
87
  \code{\link{xgettext2pot}} contain only trimmed messages.
87
 
88
 
88
  \code{ngettext} is used where the message needs to vary by a single
89
  \code{ngettext} is used where the message needs to vary by a single
89
  integer.  Translating such messages is subject to very specific rules
90
  integer.  Translating such messages is subject to very specific rules
90
  for different languages: see the GNU \verb{gettext} manual.  The string
91
  for different languages: see the GNU \verb{gettext} manual.  The string
91
  will often contain a single instance of \code{\%d} to be used in
92
  will often contain a single instance of \code{\%d} to be used in