Skip to content

Commit 023b9f3

Browse files
author
ripley
committed
tweaks
git-svn-id: https://svn.r-project.org/R/trunk@88015 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent edfa1de commit 023b9f3

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

doc/manual/R-admin.texi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,7 @@ names and so @env{LANGUAGE} may need to be set. (One example is
27892789
language to Spanish.)
27902790

27912791
Environment variable @env{LANGUAGE} can be used to specify more than one
2792-
language (and optionally territory) separated by colons.
2792+
language (and optionally territory): see below.
27932793

27942794
It is usually possible to change the language once @R{} is running
27952795
@emph{via} (not Windows) @code{Sys.setlocale("LC_MESSAGES",
@@ -2800,7 +2800,7 @@ English.} the language you are changing to can be output in the current
28002800
character set. But this is OS-specific, and has been known to stop
28012801
working on an OS upgrade. Note that translated messages may be cached,
28022802
so attempting to change the language of an error that has already been
2803-
output in another language may not work.
2803+
output in another language may not work. See also @code{Sys.setlanguage()}.
28042804

28052805
Messages are divided into @emph{domains}, and translations may be
28062806
available for some or all messages in a domain. @R{} makes use of the
@@ -2851,12 +2851,12 @@ locales specifying Portugal.
28512851

28522852
Translations in the right language but the wrong charset are made use of
28532853
@enindex LANGUAGE
2854-
by on-the-fly re-encoding. The @env{LANGUAGE} variable (only) can be a
2855-
colon-separated list, for example @samp{se:de}, giving a set of
2856-
languages in decreasing order of preference. One special value is
2857-
@samp{en@@quot}, which can be used in a UTF-8 locale to have American
2858-
error messages with pairs of single quotes translated to Unicode directional
2859-
quotes.
2854+
by on-the-fly re-encoding. The @env{LANGUAGE} variable can be a
2855+
colon-separated list, for example @samp{se:de} or @samp{es_MX:es},
2856+
giving a set of languages/territories in decreasing order of preference.
2857+
One special value is @samp{en@@quot}, which can be used in a UTF-8
2858+
locale to have American error messages with pairs of single quotes
2859+
translated to Unicode directional quotes.
28602860

28612861
If no suitable translation catalogue is found or a particular message is
28622862
not translated in any suitable catalogue, `English'@footnote{with
@@ -2867,8 +2867,8 @@ library used to manage message translations, includong in @code{libc}
28672867
on GNU and Alpine Linux, and as part of GNU @code{gettext} usually used
28682868
on macOS and Windows.
28692869
@c https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html#tag_08_02
2870-
The description here follows the POSIX standard, but implementations may
2871-
not.
2870+
The description here follows the POSIX 2024 standard, but implementations may
2871+
not (and apparently @code{musl}'s does not support @env{LANGUAGE}).
28722872

28732873

28742874
See @uref{https://developer.r-project.org/Translations30.html} for how to

src/library/base/man/gettext.Rd

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/gettext.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2024 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{gettext}
@@ -98,7 +98,7 @@ Sys.setLanguage(lang, unset = "en", C.vs.en = c("msg", "warn", "silent"),
9898
\code{\link{sprintf}}. If English is used, \code{msg1} is returned if
9999
\code{n == 1} and \code{msg2} in all other cases.
100100
101-
\code{bindtextdomain} is typically wrapper for the C function of the same
101+
\code{bindtextdomain} is typically a wrapper for the C function of the same
102102
name: your system may have a \command{man} page for it. With a
103103
non-\code{NULL} \code{dirname} it specifies where to look for message
104104
catalogues: with \code{dirname = NULL} it returns the current location.
@@ -130,6 +130,15 @@ Sys.setLanguage(lang, unset = "en", C.vs.en = c("msg", "warn", "silent"),
130130
Note that currently, using a non-existing language \code{lang} is still
131131
set and no translation will happen, without any \code{\link{message}}.
132132
}
133+
\section{Warning}{
134+
These functions were written assuming that environment variable
135+
\env{LANGUAGE} is supported by the implemantation of \code{libintl}.
136+
For a long time that as universally true and it is now part of the
137+
2024 POSIX specification. But in 2025 it was ignored by the
138+
implementation in \code{musl} (one of the implementations available on
139+
Alpine Linux).
140+
}
141+
133142
\seealso{
134143
\code{\link{stop}} and \code{\link{warning}} make use of \code{gettext} to
135144
translate messages.

src/library/base/man/locales.Rd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/locales.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2024 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{locales}
@@ -161,6 +161,8 @@ Sys.setlocale (category = "LC_ALL", locale = "")
161161

162162
The \sQuote{R Installation and Administration} manual for background
163163
on locales and how to find out locale names on your system.
164+
165+
\code{\link{Sys.setLanguage}}
164166
}
165167
\examples{
166168
Sys.getlocale()

0 commit comments

Comments
 (0)