Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
FileFormatSupport.php
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\FileFormatSupport;
5
8
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}
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...