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_FFS_CLASS = 1 |
const | INVALID_FFS_CLASS = 2 |
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 19 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 72 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 MetaYamlSchemaExtender.
Definition at line 194 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getFFS | ( | ) |
Definition at line 58 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getKeys | ( | ) |
@inheritDoc
Reimplemented from MessageGroupBase.
Definition at line 231 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getMessage | ( | $key, | |
$code ) |
FileBasedMessageGroup::getMessageGroupCache | ( | string | $code | ) |
Definition at line 285 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getSourceFilePath | ( | $code | ) |
string | $code | Language code. |
MWException |
Definition at line 107 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::getTargetFilename | ( | $code | ) |
Definition at line 123 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 76 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::mapCode | ( | $code | ) |
string | $code | Language code. |
Definition at line 174 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 32 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::parseExternal | ( | string | $code | ) |
string | $code | Language tag. |
Definition at line 88 of file FileBasedMessageGroup.php.
FileBasedMessageGroup::replaceVariables | ( | $pattern, | |
$code ) |
string | $pattern | |
string | $code | Language code. |
Definition at line 157 of file FileBasedMessageGroup.php.
|
protected |
Definition at line 23 of file FileBasedMessageGroup.php.
const FileBasedMessageGroup::INVALID_FFS_CLASS = 2 |
Definition at line 21 of file FileBasedMessageGroup.php.
const FileBasedMessageGroup::NO_FFS_CLASS = 1 |
Definition at line 20 of file FileBasedMessageGroup.php.