[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/formats/ -> format-android.php (summary)

GlotPress Format Android XML class

File Size: 458 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

GP_Format_Android:: (10 methods):
  print_exported_file()
  read_originals_from_file()
  generate_entry()
  extract_xliff_info()
  line()
  string_arrays()
  cmp_context()
  preserve_escaped_unicode()
  unescape()
  escape()


Class: GP_Format_Android  - X-Ref

Format class used to support Android XML file format.

print_exported_file( $project, $locale, $translation_set, $entries )   X-Ref
Generates a string the contains the $entries to export in the Android XML file format.

since: 1.0.0
return: string The exported Android XML string.
param: GP_Project         $project         The project the strings are being exported for, not used
param: GP_Locale          $locale          The locale object the strings are being exported for, not used
param: GP_Translation_Set $translation_set The locale object the strings are being
param: GP_Translation     $entries         The entries to export.

read_originals_from_file( $file_name )   X-Ref
Reads a set of original strings from an Android XML file.

since: 1.0.0
return: Translations|bool The extracted originals on success, false on failure.
param: string $file_name The name of the uploaded Android XML file.

generate_entry( $string, $context )   X-Ref
Generates a translation entry object to be added to the results for the "read_originals_from_file()" function.

since: 1.0.0
return: obj A translation entry object.
param: obj    $string  The string entry objectto use.
param: string $context The context string to use.

extract_xliff_info( $string )   X-Ref
Extracts the xliff information from a string.

since: 1.0.0
return: array|bool An array containing the extracted information from the xliff tags (there may be multiple) on success, false on failure.
param: string $string The string to process.

line( $string, $prepend_tabs = 0 )   X-Ref
Save a line to the exported class variable.  Supports prepending of tabs and appending
a newline to the string.

since: 1.0.0
param: string $string       The string to process.
param: int    $prepend_tabs The number of tab characters to prepend to the output.

string_arrays( $entries )   X-Ref
Output the strings array entries to the exported class variable.

since: 1.0.0
param: obj $entries The entries to store.

cmp_context( $a, $b )   X-Ref
Compare two context strings for a uasort callback.

since: 1.0.0
return: int Returns the result of the comparison.
param: string $a The first string to compare.
param: string $b The second string to compare.

preserve_escaped_unicode( $string )   X-Ref
Preserve a Unicode sequence (like \u1234) by adding another backslash.

since: 3.0
return: string Returns the string with double-escaped Unicode sequences.
param: string $string The string to process.

unescape( $string )   X-Ref
Unescapes a string with c style slashes.

since: 1.0.0
return: string Returns the unescaped string.
param: string $string The string to unescape.

escape( $string )   X-Ref
Escapes a string with c style slashes and html entities as required.

since: 1.0.0
return: string Returns the escaped string.
param: string $string The string to escape.



Generated: Wed Nov 20 01:01:59 2019 Cross-referenced by PHPXref 0.7.1