Skip to contents

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"))

Arguments

locale

Character. The locale to set. Currently supported values are "en" (English, default) and "de" (German). German translations are particularly important for G-BA/AMNOG dossier submissions.

Value

Invisibly returns the previous locale setting.

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)