GettextFFS Class Reference
[File format support]

New-style FFS class that implements support for gettext file format. More...

Inheritance diagram for GettextFFS:
Inheritance graph
[legend]
Collaboration diagram for GettextFFS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 supportsFuzzy ()
 Query the capabilities of this FFS.
 getFileExtensions ()
 Return the commonly used file extensions for these formats.
 setOfflineMode ($value)
 readFromVariable ($data)
 Parse the message data given as a string in the SimpleFFS format and return it as an array of AUTHORS and MESSAGES.
 parseGettext ($data)

Static Public Member Functions

static parseGettextData ($data, $useCtxtAsKey, $mangler, $keyAlgorithm)
 Parses gettext file as string into internal representation.
static parseGettextSection ($section, $pluralCount, &$metadata)
static processGettextPluralMessage ($pluralCount, $section)
static parseFlags ($section)
static expectKeyword ($name, $section)
static generateKeyFromItem (array $item, $algorithm= 'legacy')
 Generates unique key for each message.
static formatForWiki ($data, $whitespace= 'mark')
 This parses the Gettext text block format.
static parseHeaderTags ($headers)
static getPluralRule ($code)
 Returns plural rule for Gettext.

Protected Member Functions

 writeReal (MessageCollection $collection)
 doGettextHeader (MessageCollection $collection, $template, &$pluralCount)
 doAuthors (MessageCollection $collection)
 formatMessageBlock ($key, $m, $trans, $pot, $pluralCount)
 getPotTime ()
 getGenerator ()
 formatDocumentation ($key)
 splitPlural ($text, $forms)

Static Protected Member Functions

static chainGetter ($key, $a, $b, $default)
static formatTime ($time)
static escape ($line)

Protected Attributes

 $offlineMode = false

Detailed Description

New-style FFS class that implements support for gettext file format.

Definition at line 22 of file GettextFFS.php.


Member Function Documentation

static GettextFFS::chainGetter ( key,
a,
b,
default 
) [static, protected]

Definition at line 526 of file GettextFFS.php.

Referenced by formatMessageBlock().

GettextFFS::doAuthors ( MessageCollection collection  )  [protected]

Definition at line 451 of file GettextFFS.php.

Referenced by doGettextHeader().

Here is the call graph for this function:

GettextFFS::doGettextHeader ( MessageCollection collection,
template,
&$  pluralCount 
) [protected]

Definition at line 384 of file GettextFFS.php.

Referenced by writeReal().

Here is the call graph for this function:

static GettextFFS::escape ( line  )  [static, protected]

Definition at line 579 of file GettextFFS.php.

Referenced by doGettextHeader(), and formatMessageBlock().

static GettextFFS::expectKeyword ( name,
section 
) [static]
GettextFFS::formatDocumentation ( key  )  [protected]

Definition at line 553 of file GettextFFS.php.

Referenced by formatMessageBlock().

Here is the call graph for this function:

static GettextFFS::formatForWiki ( data,
whitespace = 'mark' 
) [static]

This parses the Gettext text block format.

Since trailing whitespace is not allowed in MediaWiki pages, the default action is to append \-character at the end of the message. You can also choose to ignore it and use the trim action instead.

Parameters:
$data 
$whitespace string
Exceptions:
MWException 
Returns:
string

Definition at line 334 of file GettextFFS.php.

Referenced by parseGettextData(), parseGettextSection(), and processGettextPluralMessage().

GettextFFS::formatMessageBlock ( key,
m,
trans,
pot,
pluralCount 
) [protected]

Definition at line 463 of file GettextFFS.php.

Referenced by writeReal().

Here is the call graph for this function:

static GettextFFS::formatTime ( time  )  [static, protected]

Definition at line 536 of file GettextFFS.php.

Referenced by doGettextHeader().

static GettextFFS::generateKeyFromItem ( array $  item,
algorithm = 'legacy' 
) [static]

Generates unique key for each message.

Changing this WILL BREAK ALL existing pages!

Parameters:
array $item As returned by parseGettextSection
string $algorithm Algorithm used to generate message keys: simple or legacy
Returns:
string

Definition at line 295 of file GettextFFS.php.

Referenced by parseGettextData(), GettextFFSTest::testHashing(), and GettextFFSTest::testMangling().

GettextFFS::getFileExtensions (  ) 

Return the commonly used file extensions for these formats.

Include the dot.

Returns:
string[]
Since:
2013-04

Reimplemented from SimpleFFS.

Definition at line 27 of file GettextFFS.php.

GettextFFS::getGenerator (  )  [protected]

Definition at line 548 of file GettextFFS.php.

Referenced by doGettextHeader().

static GettextFFS::getPluralRule ( code  )  [static]

Returns plural rule for Gettext.

Parameters:
$code   String   Language code.
Returns:
  String  

Definition at line 594 of file GettextFFS.php.

Referenced by doGettextHeader().

GettextFFS::getPotTime (  )  [protected]

Definition at line 542 of file GettextFFS.php.

Referenced by doGettextHeader().

static GettextFFS::parseFlags ( section  )  [static]

Definition at line 265 of file GettextFFS.php.

Referenced by parseGettextData(), and parseGettextSection().

GettextFFS::parseGettext ( data  ) 

Definition at line 59 of file GettextFFS.php.

Referenced by readFromVariable().

Here is the call graph for this function:

static GettextFFS::parseGettextData ( data,
useCtxtAsKey,
mangler,
keyAlgorithm 
) [static]

Parses gettext file as string into internal representation.

Parameters:
string $data
bool $useCtxtAsKey Whether to create message keys from the context or use msgctxt (non-standard po-files)
StringMangler $mangler
string $keyAlgorithm Key generation algorithm, see generateKeyFromItem
Exceptions:
MWException 
Returns:
array

Definition at line 80 of file GettextFFS.php.

Referenced by parseGettext().

Here is the call graph for this function:

static GettextFFS::parseGettextSection ( section,
pluralCount,
&$  metadata 
) [static]

Definition at line 163 of file GettextFFS.php.

Referenced by parseGettextData().

Here is the call graph for this function:

static GettextFFS::parseHeaderTags ( headers  )  [static]

Definition at line 353 of file GettextFFS.php.

Referenced by parseGettextData().

static GettextFFS::processGettextPluralMessage ( pluralCount,
section 
) [static]

Definition at line 244 of file GettextFFS.php.

Referenced by parseGettextSection().

Here is the call graph for this function:

GettextFFS::readFromVariable ( data  ) 

Parse the message data given as a string in the SimpleFFS format and return it as an array of AUTHORS and MESSAGES.

Parameters:
$data string
Returns:
array
Exceptions:
MWException 

Reimplemented from SimpleFFS.

Definition at line 40 of file GettextFFS.php.

Here is the call graph for this function:

GettextFFS::setOfflineMode ( value  ) 
Parameters:
$value bool

Definition at line 36 of file GettextFFS.php.

GettextFFS::splitPlural ( text,
forms 
) [protected]

Definition at line 610 of file GettextFFS.php.

Referenced by formatMessageBlock().

Here is the call graph for this function:

GettextFFS::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 23 of file GettextFFS.php.

GettextFFS::writeReal ( MessageCollection collection  )  [protected]
Parameters:
$collection MessageCollection
Returns:
string

Reimplemented from SimpleFFS.

Definition at line 366 of file GettextFFS.php.

Here is the call graph for this function:


Member Data Documentation

GettextFFS::$offlineMode = false [protected]

Definition at line 31 of file GettextFFS.php.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:46 2013 for MediaWiki Translate Extension by  doxygen 1.6.3