This class implements default behavior for file based message groups. More...
Public Member Functions | |
getFFS () | |
exists () | |
If this function returns false, the message group is ignored and treated like it would not be configured at all. | |
load ( $code) | |
Returns a list of messages in a given language code. | |
parseExternal (string $code) | |
getSourceFilePath ( $code) | |
getTargetFilename ( $code) | |
replaceVariables ( $pattern, $code) | |
mapCode ( $code) | |
getKeys () | |
@inheritDoc | |
initCollection ( $code) | |
@inheritDoc | |
getMessage ( $key, $code) | |
@inheritDoc | |
getMessageGroupCache (string $code) | |
![]() | |
getConfiguration () | |
getId () | |
Returns the unique identifier for this group. | |
getLabel (IContextSource $context=null) | |
Returns the human readable label (as plain text). | |
getDescription (IContextSource $context=null) | |
Returns a longer description about the group. | |
getIcon () | |
Returns an icon for this message group if any. | |
getNamespace () | |
Returns the namespace where messages are placed. | |
isMeta () | |
getSourceLanguage () | |
Returns language code depicting the language of source text. | |
getDefinitions () | |
Shortcut for load( getSourceLanguage() ). | |
getValidator () | |
Returns a message validator object or null. | |
getMangler () | |
Return a message mangler or null. | |
getInsertablesSuggester () | |
Returns the configured InsertablesSuggester if any. | |
getTags ( $type=null) | |
Returns message tags. | |
getMessageGroupStates () | |
Get the message group workflow state configuration. | |
getTranslatableLanguages () | |
@inheritDoc | |
getSupportConfig () | |
Gets support URL defined for the group if any. | |
Static Public Member Functions | |
static | newFromMessageGroup (MessageGroup $group, string $targetPattern='') |
Constructs a FileBasedMessageGroup from any normal message group. | |
static | getExtraSchema () |
Return a data structure that will be merged with the base schema. | |
![]() | |
static | factory ( $conf) |
Public Attributes | |
const | NO_FILE_FORMAT = 1 |
Protected Attributes | |
$reverseCodeMap | |
![]() | |
$conf | |
$namespace | |
$mangler | |
Additional Inherited Members | |
![]() | |
getFromConf ( $section, $key=null) | |
parseTags ( $patterns) | |
getRawTags ( $type=null) | |
setTags (MessageCollection $collection) | |
parseNamespace () | |
isSourceLanguage ( $code) | |
This class implements default behavior for file based message groups.
File based message groups are primary type of groups at translatewiki.net, while other projects may use mainly page translation message groups, or custom type of message groups.
Definition at line 26 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::exists | ( | ) |
If this function returns false, the message group is ignored and treated like it would not be configured at all.
Useful for graceful degradation. Try to keep the check fast to avoid performance problems.
Implements MessageGroup.
Definition at line 80 of file FileBasedMessageGroup.php.
|
static |
Return a data structure that will be merged with the base schema.
It is not possible to remove things.
Implements MediaWiki\Extension\Translate\MessageGroupConfiguration\MetaYamlSchemaExtender.
Definition at line 201 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getFFS | ( | ) |
Definition at line 64 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getKeys | ( | ) |
@inheritDoc
Reimplemented from MessageGroupBase.
Definition at line 240 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getMessage | ( | $key, | |
$code ) |
FileBasedMessageGroup::getMessageGroupCache | ( | string | $code | ) |
Definition at line 294 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getSourceFilePath | ( | $code | ) |
string | $code | Language code. |
Definition at line 114 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getTargetFilename | ( | $code | ) |
Definition at line 130 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::initCollection | ( | $code | ) |
FileBasedMessageGroup::load | ( | $code | ) |
Returns a list of messages in a given language code.
For some groups that list may be identical with the translation in the wiki. For other groups the messages may be loaded from a file (and differ from the current translations or definitions).
string | $code |
Implements MessageGroup.
Definition at line 84 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::mapCode | ( | $code | ) |
string | $code | Language code. |
Definition at line 181 of file FileBasedMessageGroup.php.
|
static |
Constructs a FileBasedMessageGroup from any normal message group.
Useful for doing special Gettext exports from any group.
MessageGroup | $group | |
string | $targetPattern | Value for FILES.targetPattern |
Definition at line 38 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::parseExternal | ( | string | $code | ) |
string | $code | Language tag. |
Definition at line 96 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::replaceVariables | ( | $pattern, | |
$code ) |
string | $pattern | |
string | $code | Language code. |
Definition at line 164 of file FileBasedMessageGroup.php.
|
protected |
Definition at line 29 of file FileBasedMessageGroup.php.
const FileBasedMessageGroup::NO_FILE_FORMAT = 1 |
Definition at line 27 of file FileBasedMessageGroup.php.