find_source_in_file | R Documentation |
Find and extract source text that must be translated from a single file
or a set of R expr
tokens.
Arguments listed below are not explicitly validated for efficiency.
find_source_in_file(
path = "",
encoding = "UTF-8",
verbose = getOption("transltr.verbose", TRUE),
algorithm = algorithms(),
interface = NULL
)
find_source_in_exprs(
tokens = utils::getParseData(),
path = "",
algorithm = algorithms(),
interface = NULL
)
find_source_exprs(path = "", encoding = "UTF-8")
is_source(x, interface = NULL)
path |
A non-empty and non-NA character string. A path to an R source script. |
encoding |
A non-empty and non-NA character string. The source character encoding. In almost all cases, this should be UTF-8. Other encodings are internally re-encoded to UTF-8 for portability. |
verbose |
A non-NA logical value. Should progress information be reported? |
algorithm |
A non-empty and non-NA character string equal to |
interface |
A |
tokens |
A |
x |
Any R object. |
find_source_in_exprs()
silently skips parsing errors. See find_source()
for more information.
is_source()
checks if an object conceptually represents a source text.
This can either be
a call
to method Translator$translate()
or
a call
to a custom function referenced by interface
.
Calls to method Translator$translate()
that include
...
in their argument(s) are ignored. Such calls are part
of the definition of a custom interface
and should not be extracted.
find_source_in_file()
and find_source_in_exprs()
return a list of
Text
objects. It may contain duplicated elements, depending
on the extracted contents.
find_source_exprs()
returns a subset of the output of
utils::getParseData()
. Only expr
tokens are returned.
is_source()
returns a logical value.
Text
,
find_source()
,
utils::getParseData()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.