Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
AndroidXmlFFS Class Reference

Support for XML translation format used by Android. More...

Inheritance diagram for AndroidXmlFFS:
SimpleFFS FFS

Public Member Functions

 __construct (FileBasedMessageGroup $group)
 
 supportsFuzzy ()
 Query the capabilities of this FFS.
 
 getFileExtensions ()
 Return the commonly used file extensions for these formats.
 
 readFromVariable ( $data)
 
 isContentEqual ( $a, $b)
 Checks whether two strings are equal.
 
- Public Member Functions inherited from SimpleFFS
 setGroup (FileBasedMessageGroup $group)
 
 getGroup ()
 
 setWritePath ( $writePath)
 
 getWritePath ()
 
 exists ( $code=false)
 Returns true if the file for this message group in a given language exists.
 
 read ( $code)
 Reads messages from the file in a given language and returns an array of AUTHORS, MESSAGES and possibly other properties.
 
 write (MessageCollection $collection)
 Write the collection to file.
 
 writeIntoVariable (MessageCollection $collection)
 Read a collection and return it as a SimpleFFS formatted string.
 
 filterAuthors (array $authors, $code)
 Remove excluded authors.
 
 shouldOverwrite ( $a, $b)
 Allows to skip writing the export output into a file.
 
 isGroupFfsReadable ()
 Check if the file format of the current group is readable by the file format system.
 

Protected Member Functions

 scrapeAuthors ( $string)
 
 readElementContents ( $element)
 
 formatElementContents ( $contents)
 
 doAuthors (MessageCollection $collection)
 
 writeReal (MessageCollection $collection)
 
 getFlattener ()
 
- Protected Member Functions inherited from SimpleFFS
 tryReadSource ( $filename, MessageCollection $collection)
 This tries to pick up external authors in the source files so that they are not lost if those authors are not among those who have translated in the wiki.
 
 tryReadFile ( $filename)
 Read the contents of $filename and return it as a string.
 

Additional Inherited Members

- Static Public Member Functions inherited from SimpleFFS
static fixNewLines ( $data)
 Replaces all Windows and Mac line endings with Unix line endings.
 
- Protected Attributes inherited from SimpleFFS
 $group
 
 $writePath
 
 $extra
 Stores the FILES section of the YAML configuration, which can be accessed for extra FFS class specific options.
 

Detailed Description

Support for XML translation format used by Android.

Since
2012-08-19

Definition at line 17 of file AndroidXmlFFS.php.

Constructor & Destructor Documentation

◆ __construct()

AndroidXmlFFS::__construct ( FileBasedMessageGroup $group)

Reimplemented from SimpleFFS.

Definition at line 21 of file AndroidXmlFFS.php.

Member Function Documentation

◆ doAuthors()

AndroidXmlFFS::doAuthors ( MessageCollection $collection)
protected

Definition at line 125 of file AndroidXmlFFS.php.

◆ formatElementContents()

AndroidXmlFFS::formatElementContents ( $contents)
protected

Definition at line 108 of file AndroidXmlFFS.php.

◆ getFileExtensions()

AndroidXmlFFS::getFileExtensions ( )

Return the commonly used file extensions for these formats.

Include the dot.

Returns
string[]
Since
2013-04

Reimplemented from SimpleFFS.

Definition at line 30 of file AndroidXmlFFS.php.

◆ getFlattener()

AndroidXmlFFS::getFlattener ( )
protected

Definition at line 204 of file AndroidXmlFFS.php.

◆ isContentEqual()

AndroidXmlFFS::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.

Parameters
string$a
string$b
Returns
bool
Since
2016.11

Reimplemented from SimpleFFS.

Definition at line 209 of file AndroidXmlFFS.php.

◆ readElementContents()

AndroidXmlFFS::readElementContents ( $element)
protected

Definition at line 93 of file AndroidXmlFFS.php.

◆ readFromVariable()

AndroidXmlFFS::readFromVariable ( $data)
Parameters
string$data
Returns
array Parsed data.

Reimplemented from SimpleFFS.

Definition at line 38 of file AndroidXmlFFS.php.

◆ scrapeAuthors()

AndroidXmlFFS::scrapeAuthors ( $string)
protected

Definition at line 79 of file AndroidXmlFFS.php.

◆ supportsFuzzy()

AndroidXmlFFS::supportsFuzzy ( )

Query the capabilities of this FFS.

Allowed values are:

  • yes
  • write (ignored on read)
  • no (stripped on write)
    Returns
    string
    Since
    2013-03-05

Reimplemented from SimpleFFS.

Definition at line 26 of file AndroidXmlFFS.php.

◆ writeReal()

AndroidXmlFFS::writeReal ( MessageCollection $collection)
protected
Parameters
MessageCollection$collection
Returns
string

Reimplemented from SimpleFFS.

Definition at line 147 of file AndroidXmlFFS.php.


The documentation for this class was generated from the following file: