Translate extension for MediaWiki
Loading...
Searching...
No Matches
FileFormatSupport.php
1
<?php
2
declare( strict_types = 1 );
3
4
namespace
MediaWiki\Extension\Translate\FileFormatSupport;
5
8
use
FileBasedMessageGroup
;
9
use
MediaWiki\Extension\Translate\MessageLoading\MessageCollection
;
10
20
interface
FileFormatSupport
{
21
public
function
__construct(
FileBasedMessageGroup
$group );
22
27
public
function
setWritePath
(
string
$target );
28
30
public
function
getWritePath
(): string;
31
39
public
function
read
(
string
$code );
40
47
public
function
readFromVariable
(
string
$data ): array;
48
54
public
function
write
(
MessageCollection
$collection );
55
61
public
function
writeIntoVariable
(
MessageCollection
$collection ): string;
62
69
public
function
supportsFuzzy
(): string;
70
76
public
function
isContentEqual
( ?
string
$a, ?
string
$b ): bool;
77
82
public
function
getFileExtensions
(): array;
83
92
public
function
shouldOverwrite
(
string
$a,
string
$b ): bool;
93
}
FileBasedMessageGroup
This class implements default behavior for file based message groups.
Definition
FileBasedMessageGroup.php:27
MediaWiki\Extension\Translate\MessageLoading\MessageCollection
This file contains the class for core message collections implementation.
Definition
MessageCollection.php:38
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport
Interface for file format support classes.
Definition
FileFormatSupport.php:20
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\writeIntoVariable
writeIntoVariable(MessageCollection $collection)
Quick shortcut for getting the plain exported data.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\isContentEqual
isContentEqual(?string $a, ?string $b)
Checks whether two strings are equal.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\getWritePath
getWritePath()
Get the file's location in the system.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\write
write(MessageCollection $collection)
Writes to the location provided with setWritePath and group specific directory structure.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\setWritePath
setWritePath(string $target)
Set the file's location in the system.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\shouldOverwrite
shouldOverwrite(string $a, string $b)
Allows to skip writing the export output into a file.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\supportsFuzzy
supportsFuzzy()
Query the capabilities of this FFS.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\readFromVariable
readFromVariable(string $data)
Same as read(), but takes the data as a parameter.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\getFileExtensions
getFileExtensions()
Return the commonly used file extensions for these formats.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport\read
read(string $code)
Will parse messages, authors, and any custom data from the file and return it in associative array wi...
src
FileFormatSupport
FileFormatSupport.php
Generated by
1.10.0