Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageProcessing\StringMangler Interface Reference

Interface that key-mangling classes must implement. More...

Inheritance diagram for MediaWiki\Extension\Translate\MessageProcessing\StringMangler:
MediaWiki\Extension\Translate\MessageProcessing\StringMatcher

Public Member Functions

 setConf (array $configuration)
 General way to pass configuration to the mangler.
 
 matches (string $key)
 Match strings against a pattern.
 
 mangle (string $key)
 Mangle a string.
 
 mangleList (array $list)
 Mangle a list of strings.
 
 mangleArray (array $array)
 Mangle the keys of an array.
 
 unmangle (string $key)
 Reverse mangling of a string.
 
 unmangleList (array $list)
 Reverse mangling a list of strings.
 
 unmangleArray (array $array)
 Reverse mangling of the keys of an array.
 

Detailed Description

Interface that key-mangling classes must implement.

Mangling is done to:

  • converting characters which would be invalid in titles to something valid
  • prefixing a set of messages to avoid conflicts when sharing a namespace with multiple message groups.

The operations have to be reversible so that x equals unmangle( mangle( x ) ).

Author
Niklas Laxström @license GPL-2.0-or-later

Definition at line 18 of file StringMangler.php.

Member Function Documentation

◆ mangle()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::mangle ( string $key)

◆ mangleArray()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::mangleArray ( array $array)

Mangle the keys of an array.

Parameters
array<string,mixed>$array
Returns
array<string,mixed>

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ mangleList()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::mangleList ( array $list)

Mangle a list of strings.

Parameters
string[]$list
Returns
string[]

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ matches()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::matches ( string $key)

Match strings against a pattern.

If string matches, mangle() prefixes the key.

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ setConf()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::setConf ( array $configuration)

General way to pass configuration to the mangler.

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ unmangle()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::unmangle ( string $key)

Reverse mangling of a string.

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ unmangleArray()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::unmangleArray ( array $array)

Reverse mangling of the keys of an array.

Parameters
array<string,mixed>$array
Returns
array<string,mixed>

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.

◆ unmangleList()

MediaWiki\Extension\Translate\MessageProcessing\StringMangler::unmangleList ( array $list)

Reverse mangling a list of strings.

Parameters
string[]$list
Returns
string[]

Implemented in MediaWiki\Extension\Translate\MessageProcessing\StringMatcher.


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