Class used test private/protected and/or override methods.

package GlotPress
inherited_from \GP_Format_PO

 Methods

Make private/protected methods readable for tests.

__call(callable $name, array $arguments) : mixed | boolean

Parameters

$name

callable

Method to call.

$arguments

array

Arguments to pass when calling.

Returns

mixedbooleanReturn value of the callback, false otherwise.

Gets the list of supported file extensions.

get_file_extensions() : array
Inherited
since 2.0.0

Returns

arraySupported file extensions.

get_language_code()

get_language_code() : 
magic
method

Returns

print_exported_file()

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

Parameters

$project

$locale

$translation_set

$entries

read_originals_from_file()

read_originals_from_file($file_name) 
Inherited

Parameters

$file_name

read_translations_from_file()

read_translations_from_file($file_name, $project = null
Inherited

Parameters

$file_name

$project

Overrides the value of the 'X-Generator' header field.

set_header(\GP_Format $format, string $header, string $text) 
inherited_from \GP_Format_PO::set_header()

Parameters

$format

\GP_Format

The format.

$header

string

The header field name.

$text

string

The header field value.

Add a comment before the headers for the selected format, overrideable by child classes.

add_comments_before_headers(\GP_Format $format, string $text) 
Inherited
since 2.1.0

Parameters

$format

\GP_Format

The format object to set the header for.

$text

string

The text to add to the comment.

Create a string that represents the value for the "Language:" header for an export file.

get_language_code(\GP_Locale $locale) : string | false
Inherited
since 2.1.0

Parameters

$locale

\GP_Locale

The locale object.

Returns

stringfalseReturns false if the locale object does not have any iso_639 language code, otherwise returns the shortest possible language code string.

Add a header to the selected format, overrideable by child classes.

set_header(\GP_Format $format, string $header, string $text) 
Inherited
since 2.1.0

Parameters

$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.

 Properties

 

$alt_extensions

$alt_extensions 

Default

array()
 

$class

$class 

Default

'PO'
 

$extension

$extension 

Default

''
 

$filename_pattern

$filename_pattern 

Default

'%s-%s'
 

$name

$name 

Default

''
 

List of private/protected methods.

$non_accessible_methods : array

Default

array('get_language_code')