Description Usage Arguments Details Value Note Examples
View source: R/generate_po_from_pot.R
Generates a PO object from a POT object.
1 2 3 4 | generate_po_from_pot(x, lang, ...)
## S3 method for class 'po'
generate_po_from_pot(x, lang, ...)
|
x |
An object of class |
lang |
A language code, possibly with a country code attached. See
|
... |
Currently unused. |
The file_type
element is changed from "pot" to "po", and
"Language" and "Plural-Forms" values are added to the metadata element.
An object of class po
, ready to be written to a PO file by
write_po
.
If the plural form is unknown for the specified language, the plural
form is set to NA
. See plural_forms
for supported
languages.
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)
# It's a good idea to fix the metadata before you generate the PO files
pot_fixed <- fix_metadata(pot, system.file(package = "poio"))
# Call generate_po_from_pot for each language that you want to translate to
two_pos <- lapply(
c(German = "de", Qatari_Arabic = "ar_QA"),
generate_po_from_pot,
x = pot_fixed
)
# Notice the Language and Plural-forms elements in the metadata
two_pos$German$metadata
# Also notice that the countable msgstr elements for Arabic now
# have length 6, since Arabic has 6 plural forms
two_pos$Qatari_Arabic$countable$msgstr
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.