| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Class for working with PO files
| Version: | $Id: po.php 1158 2015-11-20 04:31:23Z dd32 $ |
| File Size: | 517 lines (15 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 1 file wp-includes/pomo/translations.php |
PO:: (17 methods):
export_headers()
export_entries()
export()
export_to_file()
set_comment_before_headers()
poify()
unpoify()
prepend_each_line()
comment_block()
export_entry()
match_begin_and_end_newlines()
import_from_file()
is_final()
read_entry()
read_line()
add_comment_to_entry()
trim_quotes()
| export_headers() X-Ref |
| Exports headers to a PO entry return: string msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end |
| export_entries() X-Ref |
| Exports all entries to PO format return: string sequence of msgid/msgstr PO strings, doesn't contain a newline at the end |
| export( $include_headers = true ) X-Ref |
| Exports the whole PO file as a string param: bool $include_headers whether to include the headers in the export return: string ready for inclusion in PO file string for headers and all the entries |
| export_to_file( $filename, $include_headers = true ) X-Ref |
| Same as {@link export}, but writes the result to a file param: string $filename Where to write the PO string. param: bool $include_headers Whether to include the headers in the export. return: bool true on success, false on error |
| set_comment_before_headers( $text ) X-Ref |
| 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 param: string $text Text to include as a comment. |
| poify( $input_string ) X-Ref |
| Formats a string in PO-style param: string $input_string the string to format return: string the poified string |
| unpoify( $input_string ) X-Ref |
| Gives back the original string from a PO-formatted string param: string $input_string PO-formatted string return: string unescaped string |
| prepend_each_line( $input_string, $with ) X-Ref |
| Inserts $with in the beginning of every new line of $input_string and returns the modified string param: string $input_string prepend lines in this string param: string $with prepend lines with this string |
| comment_block( $text, $char = ' ' ) X-Ref |
| Prepare a text as a comment -- wraps the lines and prepends # and a special character to each line param: string $text the comment text param: string $char character to denote a special PO comment, |
| export_entry( $entry ) X-Ref |
| Builds a string from the entry for inclusion in PO file param: Translation_Entry $entry the entry to convert to po string. return: string|false PO-style formatted string for the entry or |
| match_begin_and_end_newlines( $translation, $original ) X-Ref |
| No description |
| import_from_file( $filename ) X-Ref |
param: string $filename return: bool |
| is_final( $context ) X-Ref |
| Helper function for read_entry param: string $context return: bool |
| read_entry( $f, $lineno = 0 ) X-Ref |
param: resource $f param: int $lineno return: null|false|array |
| read_line( $f, $action = 'read' ) X-Ref |
param: resource $f param: string $action return: bool |
| add_comment_to_entry( &$entry, $po_comment_line ) X-Ref |
param: Translation_Entry $entry param: string $po_comment_line |
| trim_quotes( $s ) X-Ref |
param: string $s return: string |
| Generated : Thu Nov 6 08:20:07 2025 | Cross-referenced by PHPXref |