en2fr | R Documentation |
These functions facilitate translation of fish and fisheries related terms
between English and French. trans()
does all the work, but the helper
functions en2fr()
and fr2en()
are probably the easiest to work with in
practice.
en2fr(
x,
translate = TRUE,
case = c("none", "sentence", "lower", "upper", "title"),
...
)
fr2en(
x,
translate = TRUE,
case = c("none", "sentence", "lower", "upper", "title"),
...
)
trans(
x,
from = "english",
to = "french",
case = c("none", "sentence", "lower", "upper", "title"),
sep = "; ",
allow_missing = FALSE,
custom_terms = NULL
)
x |
Word or phrase to translate. |
translate |
Logical: perform the translation if |
case |
Text case. |
... |
Other arguments to be passed to |
from |
Language to translate from. |
to |
Language to translate to. |
sep |
Seperator between multiple |
allow_missing |
Should the function return the input value if the term
is missing from the dictionary? If |
custom_terms |
An optional data frame that contains a temporary or
one-off translation dictionary. Must have the column names |
en2fr("Depth", TRUE)
en2fr("Depth", FALSE)
fr2en("Profondeur", TRUE)
fr2en("Profondeur", FALSE)
trans("Depth", from = "english", to = c("english", "french"))
df <- data.frame(english = c("aaa"), french = c("bbb"))
en2fr("aaa", custom_terms = df)
en2fr("Depth", TRUE, case = "none")
en2fr("Depth", TRUE, case = "upper")
en2fr("Depth", TRUE, case = "lower")
en2fr("Depth", TRUE, case = "sentence")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.