Description Usage Arguments Details Value Examples
Fixes the metadata in a po
object, as generated by
read_po
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | fix_metadata(x, pkg = ".", ..., .dots = list())
## S3 method for class 'po'
fix_metadata(
x,
pkg = ".",
clone = TRUE,
file_type = x$file_type,
...,
.dots = list()
)
## S3 method for class 'data.frame'
fix_metadata(x, pkg = ".", file_type, ..., .dots = list())
|
x |
An object of class |
pkg |
A path to the root of an R package source directory, or a
|
... |
Named arguments of new metadata values. |
.dots |
A named |
clone |
Logical. If |
file_type |
A string giving the file type; either "po" or "pot". |
Columns are added to ensure that the metadata data frame contains character columns named "name" and "value". Likewise rows are added or updated as follows.
The package name and version, taken from the
"Package" and "Version" fields of the DESCRIPTION file specified in the
pkg
argument.
The URL to report bugs to, taken from the
"BugReports" field of the DESCRIPTION file specified in the pkg
argument.
Not auto-updated.
The current date and time, in format " and time formatting specifications.
Your name and email, creepily autodetected by
whoami
, where possible.
Not auto-updated. Invent your own team name!
Always changed to "1.0".
Always changed to "text/plain; charset=UTF-8".
Always changed to "8bit".
Additionally PO, but not POT, files have these rows:
An ISO 639-1 two-letter language code. See http://www.loc.gov/standards/iso639-2/php/code_list.php
The plural-form specification for the Language code.
An object of the same type as the input, but with the metadata fixed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | pot_file <- system.file("extdata/R-summerof69.pot", package = "poio")
pot <- read_po(pot_file)
pot_fixed <- fix_metadata(pot, system.file(package = "poio"))
# Choose your own metadata
pot_fixed2 <- fix_metadata(
pot,
system.file(package = "poio"),
"Last-Translator" = "Dr. Daniel Jackson <djackson@stargate.com>",
.dots = list(
"Language-Team" = "Team RL10N!"
)
)
# Compare the metadata before and after
pot$metadata
pot_fixed$metadata
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.