PHP Class GP_Format_PO, GlotPress-WP

Inheritance: extends GP_Format
显示文件 Open project: GlotPress/GlotPress-WP Class Usage Examples

Public Properties

Property Type Description
$alt_extensions
$class
$extension
$name

Public Methods

Method Description
print_exported_file ( $project, $locale, $translation_set, $entries )
read_originals_from_file ( $file_name )
read_translations_from_file ( $file_name, $project = null )

Protected Methods

Method Description
add_comments_before_headers ( GP_Format $format, string $text ) Add a comment before the headers for the selected format, overrideable by child classes.
get_language_code ( GP_Locale $locale ) : string | false Create a string that represents the value for the "Language:" header for a po file.
set_header ( GP_Format $format, string $header, string $text ) Add a header to the selected format, overrideable by child classes.

Method Details

add_comments_before_headers() protected method

Add a comment before the headers for the selected format, overrideable by child classes.
Since: 2.1.0
protected add_comments_before_headers ( GP_Format $format, string $text )
$format GP_Format The format object to set the header for.
$text string The text to add to the comment.

get_language_code() protected method

Create a string that represents the value for the "Language:" header for a po file.
Since: 2.1.0
protected get_language_code ( GP_Locale $locale ) : string | false
$locale GP_Locale The locale object.
return string | false Returns false if the locale object does not have any iso_639 language code, otherwise returns the shortest possible language code string.

print_exported_file() public method

public print_exported_file ( $project, $locale, $translation_set, $entries )

read_originals_from_file() public method

public read_originals_from_file ( $file_name )

read_translations_from_file() public method

public read_translations_from_file ( $file_name, $project = null )

set_header() protected method

Add a header to the selected format, overrideable by child classes.
Since: 2.1.0
protected set_header ( GP_Format $format, string $header, string $text )
$format GP_Format The format object to set the header for.
$header string The header name to set.
$text string The text to set the header to.

Property Details

$alt_extensions public_oe property

public $alt_extensions

$class public_oe property

public $class

$extension public_oe property

public $extension

$name public_oe property

public $name