GlotPress Format base class. It is supposed to be inherited.
| package | GlotPress |
|---|---|
| inherited_from | \GP_Format |
get_file_extensions() : array
| since | 2.0.0 |
|---|
arraySupported 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_ProjectThe project the strings are being exported for, not used in this format but part of the scaffold of the parent object.
\GP_LocaleThe locale object the strings are being exported for. not used in this format but part of the scaffold of the parent object.
\GP_Translation_SetThe locale object the strings are being exported for. not used in this format but part of the scaffold of the parent object.
\GP_TranslationThe entries to export.
stringprint_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() |
stringThe filename of the uploaded properties file.
\Translationsboolean
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() |
stringThe filename of the uploaded properties file.
\GP_ProjectThe project object to read the translations in to.
\Translationsboolean
read_translations_from_file($file_name, $project = null)
get_language_code(\GP_Locale $locale) : string | false
| since | 2.1.0 |
|---|
\GP_LocaleThe locale object.
stringfalseReturns 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 |
|---|
stringThe string to encode.
stringescape(string $string) : string
| since | 2.0.0 |
|---|
stringThe string to escape.
stringescape_key(string $string) : string
| since | 2.0.0 |
|---|
stringThe string to escape.
stringordutf8(string $string, integer $offset) : integer | boolean
| since | 2.0.0 |
|---|
stringThe UTF-8 string to process.
integerThe offset of the string to return the character value of.
integerboolean
sort_entries(\Translations $a, \Translations $b) : integer
| since | 2.0.0 |
|---|
\TranslationsThe first translation to compare.
\TranslationsThe second translation to compare.
integersplit_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 |
|---|
stringThe line to split.
stringThe key part of the properties file string if found.
stringThe value part of the properties file string if found.
booleanReturns true if the line was split successfully, false otherwise.unescape(string $string) : string
| since | 2.0.0 |
|---|
stringThe string to unescape.
stringuni_decode(string $string) : string
| since | 2.0.0 |
|---|
stringThe string to decode.
stringuni_decode_callback(array $matches) : string
| since | 2.0.0 |
|---|
arrayThe array of matches from preg_replace_callback().
stringutf8_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
''