GlotPress Format base class. It is supposed to be inherited.
package | GlotPress |
---|---|
inherited_from | \GP_Format |
get_file_extensions() : array
since | 2.0.0 |
---|
array
Supported file extensions.print_exported_file(\GP_Project $project, \GP_Locale $locale, \GP_Translation_Set $translation_set, \GP_Translation $entries) : string
since | 2.0.0 |
---|---|
inherited_from | \GP_Format::print_exported_file() |
\GP_Project
The project the strings are being exported for, not used in this format but part of the scaffold of the parent object.
\GP_Locale
The locale object the strings are being exported for. not used in this format but part of the scaffold of the parent object.
\GP_Translation_Set
The locale object the strings are being exported for. not used in this format but part of the scaffold of the parent object.
\GP_Translation
The entries to export.
string
print_exported_file($project, $locale, $translation_set, $entries)
read_originals_from_file(string $file_name) : \Translations | boolean
since | 2.0.0 |
---|---|
inherited_from | \GP_Format::read_originals_from_file() |
string
The filename of the uploaded properties file.
\Translations
boolean
read_originals_from_file($file_name)
read_translations_from_file(string $file_name, \GP_Project $project = null
) : \Translations | boolean
since | 2.0.0 |
---|---|
inherited_from | \GP_Format::read_translations_from_file() |
string
The filename of the uploaded properties file.
\GP_Project
The project object to read the translations in to.
\Translations
boolean
read_translations_from_file($file_name, $project = null
)
get_language_code(\GP_Locale $locale) : string | false
since | 2.1.0 |
---|
\GP_Locale
The locale object.
string
false
Returns false if the locale object does not have any iso_639 language code, otherwise returns the shortest possible language code string.ascii_uni_encode(string $string) : string
since | 2.0.0 |
---|
string
The string to encode.
string
escape(string $string) : string
since | 2.0.0 |
---|
string
The string to escape.
string
escape_key(string $string) : string
since | 2.0.0 |
---|
string
The string to escape.
string
ordutf8(string $string, integer $offset) : integer | boolean
since | 2.0.0 |
---|
string
The UTF-8 string to process.
integer
The offset of the string to return the character value of.
integer
boolean
sort_entries(\Translations $a, \Translations $b) : integer
since | 2.0.0 |
---|
\Translations
The first translation to compare.
\Translations
The second translation to compare.
integer
split_properties_line(string $line, string $key, string $value) : boolean
Skips escaped values (\= or \:) in the key and matches the first unescaped instance.
since | 2.0.0 |
---|
string
The line to split.
string
The key part of the properties file string if found.
string
The value part of the properties file string if found.
boolean
Returns true if the line was split successfully, false otherwise.unescape(string $string) : string
since | 2.0.0 |
---|
string
The string to unescape.
string
uni_decode(string $string) : string
since | 2.0.0 |
---|
string
The string to decode.
string
uni_decode_callback(array $matches) : string
since | 2.0.0 |
---|
array
The array of matches from preg_replace_callback().
string
utf8_uni_encode($string) : string
since | 2.0.0 |
---|
string The string to encode.
string
$alt_extensions
array()
$exported
''
$extension
'properties'
inherited_from | \GP_Format::extension |
---|
$extension
''
$filename_pattern
'%s_%s'
inherited_from | \GP_Format::filename_pattern |
---|
$filename_pattern
'%s-%s'
$name
'Java Properties File (.properties)'
inherited_from | \GP_Format::name |
---|
$name
''