Sets the current locale for pharmhand translations. This affects all
subsequent calls to tr() and related translation functions.
Usage
set_locale(locale = c("en", "de"))Details
The locale setting is stored in a package-level environment and persists for the duration of the R session. To temporarily change the locale for a specific operation, save the current locale, change it, perform the operation, and restore the original locale.
Examples
# Set locale to German for GBA dossier
old_locale <- set_locale("de")
tr("treatment")
#> [1] "Behandlung"
# [1] "Behandlung"
# Restore previous locale
set_locale(old_locale)
