Prepare a text as a comment -- wraps the lines and prepends # and a special character to each line
static
void
comment_block
(string $text, [string $char = ' '])
-
string
$text: the comment text
-
string
$char: character to denote a special PO comment, like :, default is a space
Builds a string from the entry for inclusion in PO file
static
string|bool
export_entry
(object &$entry)
-
object
&$entry: the entry to convert to po string
Formats a string in PO-style
static
string
poify
(string $string)
-
string
$string: the string to format
Inserts $with in the beginning of every new line of $string and returns the modified string
static
void
prepend_each_line
(string $string, string $with)
-
string
$string: prepend lines in this string
-
string
$with: prepend lines with this string
static
void
trim_quotes
( $s)
Gives back the original string from a PO-formatted string
static
string
unpoify
(string $string)
-
string
$string: PO-formatted string
void
add_comment_to_entry
( &$entry, $po_comment_line)
Exports the whole PO file as a string
string
export
([bool $include_headers = true])
-
bool
$include_headers: whether to include the headers in the export
Exports all entries to PO format
string
export_entries
()
Exports headers to a PO entry
string
export_headers
()
Same as export, but writes the result to a file
bool
export_to_file
(string $filename, [bool $include_headers = true])
-
string
$filename: where to write the PO string
-
bool
$include_headers: whether to include tje headers in the export
void
import_from_file
( $filename)
void
read_entry
( $f, [ $lineno = 0])
void
read_line
( $f, [ $action = 'read'])
Text to include as a comment before the start of the PO contents
Doesn't need to include # in the beginning of lines, these are added automatically
void
set_comment_before_headers
( $text)