[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/vendor/pomo/pomo/src/ -> PO.php (summary)

This file is part of the POMO package.

Copyright: 2014 POMO
License: GPL
File Size: 587 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

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()


Class: PO  - X-Ref

Class for working with PO files.

export_headers()   X-Ref
Exports headers to a PO entry.

return: string msgid/msgstr PO entry for this PO file headers, doesn't

export_entries()   X-Ref
Exports all entries to PO format.

return: string sequence of mgsgid/msgstr PO strings, doesn't containt

export($include_headers = true)   X-Ref
Exports the whole PO file as a string.

return: string ready for inclusion in PO file string for headers and all
param: bool $include_headers whether to include the headers in the

export_to_file($filename, $include_headers = true)   X-Ref
Same as {@link export}, but writes the result to a file.

return: bool true on success, false on error
param: string $filename        where to write the PO string
param: bool   $include_headers whether to include tje headers in the

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 Comment text

poify($string)   X-Ref
Formats a string in PO-style.

return: string the poified string
param: string $string the string to format

unpoify($string)   X-Ref
Gives back the original string from a PO-formatted string.

return: string enascaped string
param: string $string PO-formatted string

prepend_each_line($string, $with)   X-Ref
Inserts $with in the beginning of every new line of $string and
returns the modified string.

return: string The modified string
param: string $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.

return: string The modified string
param: string $text the comment text
param: string $char character to denote a special PO comment,

export_entry(EntryTranslations &$entry)   X-Ref
Builds a string from the entry for inclusion in PO file.

return: false|string PO-style formatted string for the entry or
param: EntryTranslations &$entry the entry to convert to po string

match_begin_and_end_newlines($translation, $original)   X-Ref

return: string
param: $translation
param: $original

import_from_file($filename)   X-Ref

return: bool
param: string $filename

is_final($context)   X-Ref
Helper function for read_entry.

return: bool
param: string $context

read_entry($f, $lineno = 0)   X-Ref

return: null|false|array
param: resource $f
param: int      $lineno

read_line($f, $action = 'read')   X-Ref

return: bool
param: resource $f
param: string   $action

add_comment_to_entry(EntryTranslations &$entry, $po_comment_line)   X-Ref

param: EntryTranslations $entry
param: string            $po_comment_line

trim_quotes($s)   X-Ref

return: string
param: string $s



Generated: Tue Sep 27 05:10:01 2022 Cross-referenced by PHPXref 0.7.1