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
6
use
FileBasedMessageGroup
;
7
use
MediaWiki\Extension\Translate\MessageLoading\MessageCollection
;
8
19
interface
FileFormatSupport
{
20
public
function
__construct(
FileBasedMessageGroup
$group );
21
26
public
function
setWritePath
(
string
$target );
27
29
public
function
getWritePath
(): string;
30
38
public
function
read
(
string
$code );
39
46
public
function
readFromVariable
(
string
$data ): array;
47
53
public
function
write
(
MessageCollection
$collection );
54
60
public
function
writeIntoVariable
(
MessageCollection
$collection ): string;
61
68
public
function
supportsFuzzy
(): string;
69
75
public
function
isContentEqual
( ?
string
$a, ?
string
$b ): bool;
76
81
public
function
getFileExtensions
(): array;
82
91
public
function
shouldOverwrite
(
string
$a,
string
$b ): bool;
92
}
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:39
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport
Definition
FileFormatSupport.php:19
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