stop
, warning
, message
,
gettext
and gettextf
, or to
ngettext
.xgettext(dir, verbose = FALSE, asCall = TRUE)xngettext(dir, verbose = FALSE)
xgettext2pot(dir, potFile, name = "R", version, bugs)
TRUE
each argument is returned whole,
otherwise the strings within each argument are extracted.po
template file to be produced.
Defaults to version
defaults the version number of the currently running
R, and bugs
to "bugs.r-project.org"
.xgettext
, a list of objects of class "xgettext"
(which has a print
method), one per source file that
potentially contains translatable strings. For xngettext
, a list of objects of class "xngettext"
,
which are themselves lists of length-2 character strings.
gettext
, gettextf
, stop
,
warning
, and message
, as it is by the internal code that
passes strings for translation. We look to see if these functions were called with domain = NA
and if so omit the call if asCall = TRUE
: note that the
call might contain a call to gettext
which would be visible if
asCall = FALSE
.
xgettext2pot
calls xgettext
and then xngettext
,
and writes a PO template file for use with the ngettext
calls (and the rules are not stated in the Gettext
manual, but
If applied to the
update_pkg_po()
which calls xgettext2pot()
.## in a source-directory build of R:
xgettext(file.path(R.home(), "src", "library", "splines"))
Run the code above in your browser using DataLab