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

return: string The exported Android XML string.
since: 1.0.0
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.

return: Translations|bool The extracted originals on success, false on failure.
since: 1.0.0
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.

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

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

return: array|bool An array containing the extracted information from the xliff tags (there may be multiple) on success, false on failure.
since: 1.0.0
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.

return: int Returns the result of the comparison.
since: 1.0.0
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.

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

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

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

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

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



Generated: Thu Nov 21 01:01:07 2024 Cross-referenced by PHPXref 0.7.1