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

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

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

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

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

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

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

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

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.

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

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

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

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.

since: 2.0.0
return: bool Returns true if the line was split successfully, false otherwise.
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.

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

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

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

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

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

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

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

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

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

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

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

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



Generated: Tue Mar 19 01:01:21 2024 Cross-referenced by PHPXref 0.7.1