Mixed bag of methods related to translatable pages. More...
Public Member Functions | |
getTitle () | |
@inheritDoc | |
getText () | |
Returns the text for this translatable page. | |
getRevision () | |
Revision is null if object was constructed using newFromText. | |
getSourceLanguageCode () | |
Returns the source language of this translatable page. | |
getMessageGroupId () | |
@inheritDoc | |
getMessageGroup () | |
Returns MessageGroup used for translating this page. | |
hasPageDisplayTitle () | |
Check whether title is marked for translation. | |
getPageDisplayTitle (string $languageCode) | |
Get translated page title. | |
getStrippedSourcePageText () | |
getTranslationPage (string $targetLanguage) | |
addMarkedTag (int $revision, array $value=null) | |
Adds a tag which indicates that this page is suitable for translation. | |
addReadyTag (int $revision) | |
Adds a tag which indicates that this page source is ready for marking for translation. | |
getMarkedTag () | |
Returns the latest revision which has marked tag, if any. | |
getReadyTag () | |
Returns the latest revision which has ready tag, if any. | |
unmarkTranslatablePage () | |
Removes all page translation feature data from the database. | |
getTranslationUrl ( $code=false) | |
Produces a link to translation view of a translation page. | |
getMarkedRevs () | |
getTranslationPages () | |
@inheritDoc | |
getTranslationUnitPages (?string $code=null) | |
@inheritDoc | |
getTranslationPercentages () | |
getTransRev (string $suffix) | |
supportsTransclusion () | |
setTransclusion (bool $supportsTransclusion) | |
getRevisionRecordWithFallback () | |
isMoveable () | |
@inheritDoc | |
isDeletable () | |
@inheritDoc | |
Static Public Member Functions | |
static | newFromText (Title $title, string $text) |
Constructs a translatable page from given text. | |
static | newFromRevision (Title $title, int $revision) |
Constructs a translatable page from given revision. | |
static | newFromTitle (Title $title) |
Constructs a translatable page from title. | |
static | getMessageGroupIdFromTitle (Title $title) |
Constructs MessageGroup id for any title. | |
static | getTranslationPageFromTitle (Title $title) |
static | isTranslationPage (Title $title) |
static | parseTranslationUnit (LinkTarget $translationUnit) |
Helper to guess translation page from translation unit. | |
static | isSourcePage (Title $title) |
static | clearSourcePageCache () |
Clears the source page cache. | |
Public Attributes | |
const | METADATA_KEYS |
List of keys in the metadata table that need to be handled for moves and deletions @phpcs-require-sorted-array. | |
const | DISPLAY_TITLE_UNIT_ID = 'Page display title' |
Protected Member Functions | |
__construct (Title $title) | |
Protected Member Functions inherited from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle | |
getTranslationUnitPagesByTitle (Title $title, ?string $code=null) | |
Protected Attributes | |
$title | |
$revTagStore | |
$text | |
$revision | |
$source | |
$pageDisplayTitle | |
Static Protected Attributes | |
static | $tagCache = [] |
Mixed bag of methods related to translatable pages.
Definition at line 35 of file TranslatablePage.php.
|
protected |
Title | $title | Title object for the page |
Definition at line 67 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::addMarkedTag | ( | int | $revision, |
array | $value = null ) |
Adds a tag which indicates that this page is suitable for translation.
Definition at line 282 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::addReadyTag | ( | int | $revision | ) |
Adds a tag which indicates that this page source is ready for marking for translation.
Definition at line 288 of file TranslatablePage.php.
|
static |
Clears the source page cache.
Definition at line 553 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getMarkedRevs | ( | ) |
Definition at line 336 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getMarkedTag | ( | ) |
Returns the latest revision which has marked tag, if any.
Definition at line 296 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getMessageGroup | ( | ) |
Returns MessageGroup used for translating this page.
It may still be empty if the page has not been ever marked.
Definition at line 189 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getMessageGroupId | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 176 of file TranslatablePage.php.
|
static |
Constructs MessageGroup id for any title.
Definition at line 181 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getPageDisplayTitle | ( | string | $languageCode | ) |
Get translated page title.
Definition at line 218 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getReadyTag | ( | ) |
Returns the latest revision which has ready tag, if any.
Definition at line 301 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getRevision | ( | ) |
Revision is null if object was constructed using newFromText.
Definition at line 162 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getRevisionRecordWithFallback | ( | ) |
Definition at line 447 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getSourceLanguageCode | ( | ) |
Returns the source language of this translatable page.
In other words the language in which the page without language code is written.
Definition at line 171 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getStrippedSourcePageText | ( | ) |
Definition at line 242 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getText | ( | ) |
Returns the text for this translatable page.
Definition at line 123 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTitle | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 118 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTranslationPage | ( | string | $targetLanguage | ) |
Definition at line 259 of file TranslatablePage.php.
|
static |
Definition at line 250 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTranslationPages | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 350 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTranslationPercentages | ( | ) |
Definition at line 379 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTranslationUnitPages | ( | ?string | $code = null | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 375 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTranslationUrl | ( | $code = false | ) |
Produces a link to translation view of a translation page.
string | bool | $code | MediaWiki language code. Default: false. |
Definition at line 323 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::getTransRev | ( | string | $suffix | ) |
Definition at line 416 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::hasPageDisplayTitle | ( | ) |
Check whether title is marked for translation.
Definition at line 203 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::isDeletable | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 466 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::isMoveable | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundle.
Definition at line 461 of file TranslatablePage.php.
|
static |
Definition at line 527 of file TranslatablePage.php.
|
static |
Definition at line 471 of file TranslatablePage.php.
|
static |
Constructs a translatable page from given revision.
The revision must belong to the title given or unspecified behavior will happen.
MWException |
Definition at line 91 of file TranslatablePage.php.
|
static |
Constructs a translatable page from given text.
Some functions will fail unless you set revision parameter manually.
Definition at line 77 of file TranslatablePage.php.
|
static |
Constructs a translatable page from title.
The text of last marked revision is loaded when needed.
Definition at line 110 of file TranslatablePage.php.
|
static |
Helper to guess translation page from translation unit.
Definition at line 510 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::setTransclusion | ( | bool | $supportsTransclusion | ) |
Definition at line 439 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::supportsTransclusion | ( | ) |
Definition at line 430 of file TranslatablePage.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::unmarkTranslatablePage | ( | ) |
Removes all page translation feature data from the database.
Does not remove translated sections or translation pages.
Definition at line 309 of file TranslatablePage.php.
|
protected |
Definition at line 62 of file TranslatablePage.php.
|
protected |
Definition at line 58 of file TranslatablePage.php.
|
protected |
Definition at line 54 of file TranslatablePage.php.
|
protected |
Definition at line 60 of file TranslatablePage.php.
|
staticprotected |
Definition at line 279 of file TranslatablePage.php.
|
protected |
Definition at line 56 of file TranslatablePage.php.
|
protected |
Definition at line 52 of file TranslatablePage.php.
const MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::DISPLAY_TITLE_UNIT_ID = 'Page display title' |
Definition at line 49 of file TranslatablePage.php.
const MediaWiki\Extension\Translate\PageTranslation\TranslatablePage::METADATA_KEYS |
List of keys in the metadata table that need to be handled for moves and deletions @phpcs-require-sorted-array.
Definition at line 40 of file TranslatablePage.php.