[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

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

(no description)

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

Defines 1 class

GP_Format_Properties:: (13 methods):
  print_exported_file()
  utf8_uni_encode()
  ascii_uni_encode()
  uni_decode()
  uni_decode_callback()
  ordutf8()
  split_properties_line()
  read_translations_from_file()
  read_originals_from_file()
  sort_entries()
  unescape()
  escape()
  escape_key()


Class: GP_Format_Properties  - X-Ref

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

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.
return: string
since: 2.0.0

utf8_uni_encode( $string )   X-Ref
Encodes a PHP string in UTF8 format to a unicode escaped string (multi-byte characters are encoded in the \uXXXX format).

param: $string string The string to encode.
return: string
since: 2.0.0

ascii_uni_encode( $string )   X-Ref
Encodes a PHP string in ascii format to a unicode escaped string (multi-byte characters are encoded in the \uXXXX format).

param: string $string The string to encode.
return: string
since: 2.0.0

uni_decode( $string )   X-Ref
Decodes a unicode escaped string to a PHP string.

param: string $string The string to decode.
return: string
since: 2.0.0

uni_decode_callback( $matches )   X-Ref
Part of uni_decode(), this is the call back function that does the heavy lifting of converting a \uXXXX
value to a UTF-8 encoded character sequence.

param: array $matches The array of matches from preg_replace_callback().
return: string
since: 2.0.0

ordutf8( $string, &$offset )   X-Ref
Part of utf8_uni_encode(), this returns the character value of a UTF-8 encoded string.

From http://php.net/manual/en/function.ord.php#109812

param: string $string The UTF-8 string to process.
param: int    $offset The offset of the string to return the character value of.
return: int|bool
since: 2.0.0

split_properties_line( $line, &$key, &$value )   X-Ref
Splits a properties file line on the = or : character.

Skips escaped values (\= or \:) in the key and matches the first unescaped instance.

param: string $line  The line to split.
param: string $key   The key part of the properties file string if found.
param: string $value The value part of the properties file string if found.
return: bool Returns true if the line was split successfully, false otherwise.
since: 2.0.0

read_translations_from_file( $file_name, $project = null )   X-Ref
Reads a set of translations from a properties file.

param: string     $file_name The filename of the uploaded properties file.
param: GP_Project $project   The project object to read the translations in to.
return: Translations|bool
since: 2.0.0

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

param: string $file_name The filename of the uploaded properties file.
return: Translations|bool
since: 2.0.0

sort_entries( $a, $b )   X-Ref
The callback to sort the entries by, used above in print_exported_file().

param: Translations $a The first translation to compare.
param: Translations $b The second translation to compare.
return: int
since: 2.0.0

unescape( $string )   X-Ref
Unescape a string to be used as a value in the properties file.

param: string $string The string to unescape.
return: string
since: 2.0.0

escape( $string )   X-Ref
Escape a string to be used as a value in the properties file.

param: string $string The string to escape.
return: string
since: 2.0.0

escape_key( $string )   X-Ref
Escape a string to be used as a key name in the properties file.

param: string $string The string to escape.
return: string
since: 2.0.0



Generated: Sat Dec 7 01:01:07 2024 Cross-referenced by PHPXref 0.7.1