library(lang)
lang_use("ollama", "llama3.2", seed = 100)
#> Model: llama3.2 via Ollama
#> Lang: en_US.UTF-8
lang_help("lang_help", lang = "spanish", type = "text")
#> ✔ lang - Translation complete
#> _A_y_u_d_a _a _t_r_a_d_u_c_i_r _l_a _d_o_c_u_m_e_n_t_a_c_i_ó_n _d_e _u_n _p_r_o_d_u_c_t_o _e_n _u_n_a _l_e_n_g_u_a
#> _d_i_f_e_r_e_n_t_e.
#>
#> _D_e_s_c_r_i_p_t_i_o_n:
#>
#> Traduce un tema dado a una lengua objetivo. Utiliza el argumento
#> 'lang' para determinar la que lengua traducir. Si no se pasa, esta
#> función buscará a una lengua objetivo en las variables de entorno
#> LANG y LANGUAGE, o si se ha pasado algo a la función 'lang_use()'
#> con el argumento '.lang', determinará la lengua objetivo. Si la
#> lengua objetivo es inglés, no se procesará la traducción, por lo
#> que el ayuda devuelta será la documentación original del paquete.
#>
#> _U_s_a_g_e:
#>
#> lang_help(topic, package = NULL, lang = NULL, type = getOption("help_type"))
#>
#> _A_r_g_u_m_e_n_t_s:
#>
#> topic: La cadena de caracteres del tema a buscar.
#>
#> package: El paquete R para buscar el tema, si no se proporciona la
#> función intentará encontrar el tema basado en los paquetes
#> cargados.
#>
#> lang: Un carácter vector de idioma para traducir el tema a.
#>
#> type: Produce "html" o "text" como salida para la ayuda. Se
#> establece por defecto en `getOption("help_type")`.
#>
#> _V_a_l_u_e:
#>
#> Versión del documento de ayuda en el tipo de salida especificado
#>
#> _E_x_a_m_p_l_e_s:
#>
#> library(lang)
#>
#> lang_use("ollama", "llama3.2", seed = 100)
#>
#> lang_help("lang_help", lang = "spanish", type = "text")
#> Translates help documentation to another language
lang_help
Description
Translates a given topic into a target language. It uses the lang argument to determine which language to translate to. If not passed, this function will look for a target language in the LANG and LANGUAGE environment variables, or if something has been passed to the .lang argument in lang_use(), to determine the target language. If the target language is English, no translation will be processed, so the help returned will be the original package’s documentation.
Usage
lang_help(topic, package = NULL, lang = NULL, type = getOption("help_type"))Arguments
| Arguments | Description |
|---|---|
| topic | A character vector of the topic to search for. |
| package | The R package to look for the topic, if not provided the function will attempt to find the topic based on the loaded packages. |
| lang | A character vector language to translate the topic to |
| type | Produce “html” or “text” output for the help. It defaults to getOption("help_type") |
Value
Original or translated version of the help documentation in the output type specified