Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\FileFormatSupport\IniFormat Class Reference

IniFormat currently parses and generates flat ini files with language code as header key. More...

Inheritance diagram for MediaWiki\Extension\Translate\FileFormatSupport\IniFormat:
MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport

Public Member Functions

 supportsFuzzy ()
 Query the capabilities of this FFS.
 
 getFileExtensions ()
 Return the commonly used file extensions for these formats.
 
 readFromVariable (string $data)
 Parse the message data given as a string in the SimpleFormat format and return it as an array of AUTHORS and MESSAGES.
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat
 __construct (FileBasedMessageGroup $group)
 
 setGroup (FileBasedMessageGroup $group)
 
 getGroup ()
 
 setWritePath (string $target)
 Set the file's location in the system.
 
 getWritePath ()
 Get the file's location in the system.
 
 exists ( $code=false)
 Returns true if the file for this message group in a given language exists.
 
 read (string $languageCode)
 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 SimpleFormat formatted string.
 
 filterAuthors (array $authors, string $code)
 Remove excluded authors.
 
 isContentEqual (?string $a, ?string $b)
 Checks whether two strings are equal.
 
 shouldOverwrite (string $a, string $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

 writeReal (MessageCollection $collection)
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat
 tryReadSource (string $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 (string $filename)
 Read the contents of $filename and return it as a string.
 

Additional Inherited Members

- Protected Attributes inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat
FileBasedMessageGroup $group
 
string $writePath = null
 
 $extra
 

Detailed Description

IniFormat currently parses and generates flat ini files with language code as header key.

Author
Niklas Laxström

Definition at line 18 of file IniFormat.php.

Member Function Documentation

◆ getFileExtensions()

MediaWiki\Extension\Translate\FileFormatSupport\IniFormat::getFileExtensions ( )

Return the commonly used file extensions for these formats.

Include the dot.

Returns
string[]

Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.

Definition at line 23 of file IniFormat.php.

◆ readFromVariable()

MediaWiki\Extension\Translate\FileFormatSupport\IniFormat::readFromVariable ( string $data)

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

Exceptions
InvalidArgumentException

Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.

Definition at line 27 of file IniFormat.php.

◆ supportsFuzzy()

MediaWiki\Extension\Translate\FileFormatSupport\IniFormat::supportsFuzzy ( )

Query the capabilities of this FFS.

Allowed values are:

  • yes
  • write (ignored on read)
  • no (stripped on write)

Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.

Definition at line 19 of file IniFormat.php.

◆ writeReal()

MediaWiki\Extension\Translate\FileFormatSupport\IniFormat::writeReal ( MessageCollection $collection)
protected

Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.

Definition at line 52 of file IniFormat.php.


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