Format class used to support PHP file format.
| since | 4.0.0 |
|---|---|
| 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 | 4.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.
stringThe exported PHP string.print_exported_file($project, $locale, $translation_set, $entries)
read_originals_from_file(string $file_name) : false
| since | 4.0.0 |
|---|---|
| inherited_from | \GP_Format::read_originals_from_file() |
stringThe name of the uploaded PHP file.
falseAlways returns false, as this is not currently implemented.read_originals_from_file($file_name)
read_translations_from_file(string $file_name, \GP_Project $project = null) : false
| since | 4.0.0 |
|---|---|
| inherited_from | \GP_Format::read_translations_from_file() |
stringThe name of the uploaded properties file.
\GP_ProjectUnused. The project object to read the translations into.
falseAlways returns false, as this is not currently implemented.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.array_is_list(\array<mixed> $arr) : boolean
var_export(mixed $value) : string
Like \var_export() but "minified", using short array syntax and no newlines.
| since | 4.0.0 |
|---|
mixedThe variable you want to export.
stringThe variable representation.$alt_extensions
array()$extension : string
'mo.php'| since | 4.0.0 |
|---|---|
| inherited_from | \GP_Format::extension |
$extension
''$filename_pattern
'%s-%s'$name : string
'PHP (.mo.php)'| since | 4.0.0 |
|---|---|
| inherited_from | \GP_Format::name |
$name
''