Learn R Programming

msgtools (version 0.2.4)

edit_translation: Interactive translation editing

Description

Edit a translation object in-memory using a simple interface

Usage

edit_translation(translation, language, pkg = ".", domain = "R")

Arguments

translation
An object of class "po", such as returned by make_translation. In lieu of translation, language and pkg and domain can be specified, which will load the translation from file using read_translation.
language
A character string specifying a language, as either: (1) “ll”, an ISO 639 two-letter language code (lowercase), or (2) “ll_CC”, an ISO 639 two-letter language code (lowercase) and ‘CC’ is an ISO 3166 two-letter country code (uppercase).
pkg
The directory of an R package to extract diagnostic messages from. Path is passed to as.package.
domain
A character string specifying the “domain” of the messages. Either “R” (the default) or “C”. This is case insensitive.

Value

An object of class "po".

See Also

make_translation

Examples

Run this code
## Not run: 
#   # setup pkg for localization
#   pkg <- dummy_pkg()
#   use_localization(pkg = pkg)
#   
#   # generate translation in memory
#   (tran <- make_translation("es", translator = "Some Person <example@examle.com>", pkg = pkg))
#   
#   # edit translations
#   tran2 <- edit_translation(tran, pkg = pkg)
#   # write to disk
#   write_translation(tran2, pkg = pkg)
# ## End(Not run)

Run the code above in your browser using DataLab