[ 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.
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.
since: 1.0.0

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.
param: string $file_name The name of the uploaded Android XML file.
since: 1.0.0

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.
param: obj    $string  The string entry object to use.
param: string $context The context string to use.
since: 1.0.0

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.
param: string $string The string to process.
since: 1.0.0

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.

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

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

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

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

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

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.
param: string $string The string to process.
since: 3.0

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

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

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

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



Generated: Sun Dec 22 01:01:04 2024 Cross-referenced by PHPXref 0.7.1