MediaWiki  1.23.6
MessageWriter Class Reference

Static Public Member Functions

static makeComments ( $messages, $ignored, $optional)
 Generates an array of comments for messages. More...
 
static writeMessagesArray ( $messages, $ignoredComments=false, $prefix=false, $removeUnknown=false)
 Write a messages array as a PHP text. More...
 
static writeMessagesBlock ( $blockComment, $messages, $messageComments=array(), $prefix='')
 Write a block of messages to PHP. More...
 
static writeMessagesToFile ( $messages, $code, $write, $listUnknown, $removeUnknown, $messagesFolder=false)
 Write a messages array as a PHP text and write it to the messages file. More...
 

Static Protected Attributes

static $blockComments
 
static $ignoredComment = "do not translate or duplicate this message to other languages"
 
static $ignoredMessages
 
static $messageStructure
 
static $optionalComment
 
static $optionalMessages
 

Detailed Description

Definition at line 27 of file writeMessagesArray.inc.

Member Function Documentation

◆ makeComments()

static MessageWriter::makeComments (   $messages,
  $ignored,
  $optional 
)
static

Generates an array of comments for messages.

Parameters
$messagesArray: key of messages.
$ignoredArray: list of ingored message keys.
$optionalArray: list of optional message keys.
Returns
array

Definition at line 189 of file writeMessagesArray.inc.

References $ignoredComment, $messages, $optionalComment, array(), and as.

Referenced by writeMessagesArray().

◆ writeMessagesArray()

static MessageWriter::writeMessagesArray (   $messages,
  $ignoredComments = false,
  $prefix = false,
  $removeUnknown = false 
)
static

Write a messages array as a PHP text.

Parameters
$messagesArray: the messages array.
$ignoredCommentsBoolean: show comments about ignored and optional messages? (For English.)
$prefixString: base path for messages.inc and messageTypes.inc files or false for default path (this directory)
$removeUnknownBoolean: whether to remove unkown messages
Returns
Array of the PHP text and the sorted messages array.

Definition at line 119 of file writeMessagesArray.inc.

References $dir, $ignoredMessages, $messages, $optionalMessages, $wgBlockComments, $wgIgnoredMessages, $wgMessageStructure, $wgOptionalMessages, array(), as, makeComments(), and writeMessagesBlock().

Referenced by writeMessagesToFile().

◆ writeMessagesBlock()

static MessageWriter::writeMessagesBlock (   $blockComment,
  $messages,
  $messageComments = array(),
  $prefix = '' 
)
static

Write a block of messages to PHP.

Parameters
$blockCommentString: the comment of whole block.
$messagesArray: the block messages.
$messageCommentsArray: optional comments for messages in this block.
$prefixString: prefix for every line, for indenting purposes.
Returns
string The block, formatted in PHP.

Definition at line 215 of file writeMessagesArray.inc.

References $messages, $value, and as.

Referenced by writeMessagesArray().

◆ writeMessagesToFile()

static MessageWriter::writeMessagesToFile (   $messages,
  $code,
  $write,
  $listUnknown,
  $removeUnknown,
  $messagesFolder = false 
)
static

Write a messages array as a PHP text and write it to the messages file.

Parameters
$messagesArray: the messages array.
$codeString: the language code.
$writeBoolean: write to the messages file?
$listUnknownBoolean: list the unknown messages?
$removeUnknownBoolean: whether to remove unkown messages
$messagesFolderString: path to a folder to store the MediaWiki messages. Defaults to the current install.

Definition at line 48 of file writeMessagesArray.inc.

References $messages, $messagesFolder, $value, as, Language\getFileName(), Language\getMessagesFileName(), and writeMessagesArray().

Referenced by rebuildLanguage().

Member Data Documentation

◆ $blockComments

MessageWriter::$blockComments
staticprotected

Definition at line 33 of file writeMessagesArray.inc.

◆ $ignoredComment

MessageWriter::$ignoredComment = "do not translate or duplicate this message to other languages"
staticprotected

Definition at line 30 of file writeMessagesArray.inc.

Referenced by makeComments().

◆ $ignoredMessages

MessageWriter::$ignoredMessages
staticprotected

Definition at line 34 of file writeMessagesArray.inc.

Referenced by writeMessagesArray().

◆ $messageStructure

MessageWriter::$messageStructure
staticprotected

Definition at line 32 of file writeMessagesArray.inc.

◆ $optionalComment

MessageWriter::$optionalComment
staticprotected
Initial value:
=
'only translate this message to other languages if you have to change it'

Definition at line 28 of file writeMessagesArray.inc.

Referenced by makeComments().

◆ $optionalMessages

MessageWriter::$optionalMessages
staticprotected

Definition at line 35 of file writeMessagesArray.inc.

Referenced by writeMessagesArray().


The documentation for this class was generated from the following file: