Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\TranslatorInterface\Aid\InOtherLanguagesAid Class Reference

Translation aid that provides the "in other languages" suggestions. More...

Inheritance diagram for MediaWiki\Extension\Translate\TranslatorInterface\Aid\InOtherLanguagesAid:
MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid

Public Member Functions

 getData ()
 Translation aid class should implement this function.
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid
 __construct (MessageGroup $group, MessageHandle $handle, IContextSource $context, TranslationAidDataProvider $dataProvider)
 

Protected Member Functions

 getFallbacks (string $code)
 Get the languages for "in other languages".
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid
static getTypes ()
 List of available message types mapped to the classes implementing them.
 
- Protected Attributes inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid
 $group
 
 $handle
 
 $context
 
 $dataProvider
 

Detailed Description

Translation aid that provides the "in other languages" suggestions.

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

Definition at line 15 of file InOtherLanguagesAid.php.

Member Function Documentation

◆ getData()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\InOtherLanguagesAid::getData ( )

Translation aid class should implement this function.

Return value should be an array with keys and values. Because these are used in the MediaWiki API, lists (numeric keys) should have key '**' set to element name that describes the list values. For example if the translation aid provides translation suggestions, it would return an array which has key '**' set to 'suggestion' and then list of arrays, each containing fields for the information of the suggestions. See InOtherLanguagesAid for example.

Exceptions
TranslationHelperExceptionUsed to signal unexpected errors to aid debugging
Returns
array

Reimplemented from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid.

Definition at line 16 of file InOtherLanguagesAid.php.

◆ getFallbacks()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\InOtherLanguagesAid::getFallbacks ( string $code)
protected

Get the languages for "in other languages".

That would be translation assistant languages with defined language fallbacks additionally.

Parameters
string$code
Returns
string[] List of language codes

Definition at line 47 of file InOtherLanguagesAid.php.


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