AMR/man/translate.Rd

58 lines
2.3 KiB
Plaintext
Raw Normal View History

2019-05-10 16:44:59 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_locale.R
\name{translate}
\alias{translate}
\alias{get_locale}
\title{Translate strings from AMR package}
\usage{
get_locale()
}
\description{
For language-dependent output of AMR functions, like \code{\link{mo_name}}, \code{\link{mo_type}} and \code{\link{ab_name}}.
2019-05-10 16:44:59 +02:00
}
\details{
2019-06-01 20:40:49 +02:00
Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}.
2019-05-10 16:44:59 +02:00
Currently supported languages can be found if running: \code{unique(AMR:::translations_file$lang)}.
2019-06-01 20:40:49 +02:00
Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}.
2019-05-10 16:44:59 +02:00
2019-06-01 20:40:49 +02:00
This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.).
2019-05-10 16:44:59 +02:00
The system language will be used at default, if that language is supported. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
2019-05-10 16:44:59 +02:00
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
2019-05-10 16:44:59 +02:00
}
\examples{
# The 'language' parameter of below functions
# will be set automatically to your system language
# with get_locale()
# English
mo_name("CoNS", language = "en")
2019-05-10 16:44:59 +02:00
#> "Coagulase-negative Staphylococcus (CoNS)"
# German
mo_name("CoNS", language = "de")
2019-05-10 16:44:59 +02:00
#> "Koagulase-negative Staphylococcus (KNS)"
# Dutch
mo_name("CoNS", language = "nl")
2019-05-10 16:44:59 +02:00
#> "Coagulase-negatieve Staphylococcus (CNS)"
# Spanish
mo_name("CoNS", language = "es")
2019-05-10 16:44:59 +02:00
#> "Staphylococcus coagulasa negativo (SCN)"
# Italian
mo_name("CoNS", language = "it")
2019-05-10 16:44:59 +02:00
#> "Staphylococcus negativo coagulasi (CoNS)"
# Portuguese
mo_name("CoNS", language = "pt")
2019-05-10 16:44:59 +02:00
#> "Staphylococcus coagulase negativo (CoNS)"
}