Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
FileFormatSupport.php
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\FileFormatSupport;
5
10
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}
This class implements default behavior for file based message groups.
This file contains the class for core message collections implementation.
writeIntoVariable(MessageCollection $collection)
Quick shortcut for getting the plain exported data.
isContentEqual(?string $a, ?string $b)
Checks whether two strings are equal.
getWritePath()
Get the file's location in the system.
write(MessageCollection $collection)
Writes to the location provided with setWritePath and group specific directory structure.
setWritePath(string $target)
Set the file's location in the system.
shouldOverwrite(string $a, string $b)
Allows to skip writing the export output into a file.
readFromVariable(string $data)
Same as read(), but takes the data as a parameter.
getFileExtensions()
Return the commonly used file extensions for these formats.
read(string $code)
Will parse messages, authors, and any custom data from the file and return it in associative array wi...