Interface for file system support classes. More...
Public Member Functions | |
__construct (FileBasedMessageGroup $group) | |
setWritePath ( $target) | |
Set the file's location in the system. | |
getWritePath () | |
Get the file's location in the system. | |
read ( $code) | |
Will parse messages, authors, and any custom data from the file and return it in associative array with keys like AUTHORS and MESSAGES . | |
readFromVariable ( $data) | |
Same as read(), but takes the data as a parameter. | |
write (MessageCollection $collection) | |
Writes to the location provided with setWritePath and group specific directory structure. | |
writeIntoVariable (MessageCollection $collection) | |
Quick shortcut for getting the plain exported data. | |
supportsFuzzy () | |
Query the capabilities of this FFS. | |
isContentEqual ( $a, $b) | |
Checks whether two strings are equal. | |
getFileExtensions () | |
Return the commonly used file extensions for these formats. | |
shouldOverwrite ( $a, $b) | |
Allows to skip writing the export output into a file. | |
FFS::__construct | ( | FileBasedMessageGroup | $group | ) |
FFS::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Implemented in AmdFFS, AndroidXmlFFS, AppleFFS, DtdFFS, GettextFFS, IniFFS, JavaFFS, JavaScriptFFS, JsonFFS, SimpleFFS, XliffFFS, and YamlFFS.
FFS::getWritePath | ( | ) |
FFS::isContentEqual | ( | $a, | |
$b ) |
Checks whether two strings are equal.
Sometimes same content might have multiple representations. The main case are inline plurals, which in some formats require expansion at export time.
string | $a | |
string | $b |
Implemented in AndroidXmlFFS, GettextFFS, JsonFFS, SimpleFFS, and YamlFFS.
FFS::read | ( | $code | ) |
Will parse messages, authors, and any custom data from the file and return it in associative array with keys like AUTHORS
and MESSAGES
.
string | $code | Language code. |
Implemented in GettextFFS, SimpleFFS, and XliffFFS.
FFS::readFromVariable | ( | $data | ) |
Same as read(), but takes the data as a parameter.
The caller is supposed to know in what language the translations are.
string | $data | Formatted messages. |
Implemented in AmdFFS, AndroidXmlFFS, AppleFFS, DtdFFS, GettextFFS, IniFFS, JavaFFS, JavaScriptFFS, JsonFFS, SimpleFFS, and YamlFFS.
FFS::setWritePath | ( | $target | ) |
Set the file's location in the system.
string | $target | Filesystem path for exported files. |
Implemented in SimpleFFS.
FFS::shouldOverwrite | ( | $a, | |
$b ) |
Allows to skip writing the export output into a file.
This is useful to skip updates that would only update irrelevant parts, such as the timestamp of the export.
string | $a | The existing content. |
string | $b | The new export content. |
Implemented in GettextFFS, and SimpleFFS.
FFS::supportsFuzzy | ( | ) |
Query the capabilities of this FFS.
Allowed values are:
Implemented in AndroidXmlFFS, AppleFFS, GettextFFS, IniFFS, JavaFFS, SimpleFFS, and XliffFFS.
FFS::write | ( | MessageCollection | $collection | ) |
Writes to the location provided with setWritePath and group specific directory structure.
Exports translations included in the given collection with any special handling needed.
MessageCollection | $collection |
Implemented in SimpleFFS.
FFS::writeIntoVariable | ( | MessageCollection | $collection | ) |
Quick shortcut for getting the plain exported data.
Same as write(), but returns the output instead of writing it into a file.
MessageCollection | $collection |
Implemented in SimpleFFS.