Class that makes it possible to test protected functions.

package GlotPress
inherited_from \GP_Format_Android

 Methods

Gets the list of supported file extensions.

get_file_extensions() : array
Inherited
since 2.0.0

Returns

arraySupported file extensions.

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

Wraps the protected escape function

testable_escape(string $string) : string

Parameters

$string

string

The string to escape.

Returns

stringReturns escaped string.

Escapes a string with c style slashes and html entities as required.

escape(string $string) : string
Inherited
since 1.0.0

Parameters

$string

string

The string to escape.

Returns

stringReturns the escaped string.

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.

Compare two context strings for a uasort callback.

cmp_context(string $a, string $b) : integer
Inherited
since 1.0.0

Parameters

$a

string

The first string to compare.

$b

string

The second string to compare.

Returns

integerReturns the result of the comparison.

Extracts the xliff information from a string.

extract_xliff_info(string $string) : array | boolean
Inherited
since 1.0.0

Parameters

$string

string

The string to process.

Returns

arraybooleanAn array containing the extracted information from the xliff tags (there may be multiple) on success, false on failure.

Generates a translation entry object to be added to the results for the "read_originals_from_file()" function.

generate_entry(\obj $string, string $context) : \obj
Inherited
since 1.0.0

Parameters

$string

\obj

The string entry object to use.

$context

string

The context string to use.

Returns

\objA translation entry object.

Save a line to the exported class variable. Supports prepending of tabs and appending a newline to the string.

line(string $string, integer $prepend_tabs = 0
Inherited
since 1.0.0

Parameters

$string

string

The string to process.

$prepend_tabs

integer

The number of tab characters to prepend to the output.

Preserve a Unicode sequence (like \u1234) by adding another backslash.

preserve_escaped_unicode(string $string) : string
Inherited
since 3.0

Parameters

$string

string

The string to process.

Returns

stringReturns the string with double-escaped Unicode sequences.

Output the strings array entries to the exported class variable.

string_arrays(\obj $entries) 
Inherited
since 1.0.0

Parameters

$entries

\obj

The entries to store.

Unescapes a string with c style slashes.

unescape(string $string) : string
Inherited
since 1.0.0

Parameters

$string

string

The string to unescape.

Returns

stringReturns the unescaped string.

 Properties

 

$alt_extensions

$alt_extensions 

Default

array()
 

Storage for the export file contents while it is being generated.

$exported : string

Default

''
since 1.0.0
 

$extension

$extension 

Default

''
 

$filename_pattern

$filename_pattern 

Default

'%s-%s'
 

$name

$name 

Default

''