tests/testthat/test-trans_locale.R

test_that("passing a locale sets it", {
  trans_locale("pl_PL")
  expect_equal(getOption("translated_locale"), "pl_PL")
})

test_that("not passing anything allows accessing currently set locale", {
  expect_equal(trans_locale(), "pl_PL")
})

Try the translated package in your browser

Any scripts or data that you put into this service are public.

translated documentation built on April 25, 2023, 5:09 p.m.