Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore Class Reference

Class to manage revision tags for translatable bundles. More...

Public Member Functions

 __construct (IConnectionProvider $dbProvider)
 
 replaceTag (PageIdentity $identity, string $tag, int $revisionId, ?array $value=null)
 Add tag for the given revisionId, while deleting it from others.
 
 getLatestRevisionWithTag (PageIdentity $identity, string $tag)
 
 getLatestRevisionsForTags (PageIdentity $identity, string ... $tags)
 
 removeTags (PageIdentity $identity, string ... $tag)
 
 isRevIdFuzzy (int $articleId, int $revisionId)
 
 getTransver (PageIdentity $identity, ?int $revid=null)
 Get the revision ID of the original message that was live the last time a non-fuzzy translation was saved (presumably the version whose translation the translation is).
 
 setTransver (PageIdentity $identity, int $translationRevision, int $transver)
 Sets the tp:transver revtag of the given page/revision.
 

Static Public Member Functions

static getTranslatableBundleIds (string ... $revTags)
 Get a list of page ids where the latest revision is either tagged or marked.
 

Public Attributes

const FUZZY_TAG = 'fuzzy'
 Indicates that a translation is fuzzy (outdated or not passing validation).
 
const TRANSVER_PROP = 'tp:transver'
 Stores the revision id of the corresponding source text.
 
const TP_MARK_TAG = 'tp:mark'
 Indicates a revision of a page that can be marked for translation.
 
const TP_READY_TAG = 'tp:tag'
 Indicates a revision of a translatable page that is marked for translation.
 
const MB_VALID_TAG = 'mb:valid'
 Indicates a revision of a page that is a valid message bundle.
 

Detailed Description

Class to manage revision tags for translatable bundles.

Author
Abijeet Patro
Niklas Laxström
Since
2022.04 @license GPL-2.0-or-later

Definition at line 18 of file RevTagStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::__construct ( IConnectionProvider $dbProvider)

Definition at line 33 of file RevTagStore.php.

Member Function Documentation

◆ getLatestRevisionsForTags()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::getLatestRevisionsForTags ( PageIdentity $identity,
string ... $tags )
Returns
null|int[]

Definition at line 81 of file RevTagStore.php.

◆ getLatestRevisionWithTag()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::getLatestRevisionWithTag ( PageIdentity $identity,
string $tag )

Definition at line 75 of file RevTagStore.php.

◆ getTranslatableBundleIds()

static MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::getTranslatableBundleIds ( string ... $revTags)
static

Get a list of page ids where the latest revision is either tagged or marked.

Definition at line 223 of file RevTagStore.php.

◆ getTransver()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::getTransver ( PageIdentity $identity,
?int $revid = null )

Get the revision ID of the original message that was live the last time a non-fuzzy translation was saved (presumably the version whose translation the translation is).

Used to determine whether the translation is outdated and to show a diff of the original message if it is.

If a revision ID argument is specified, then ignore all versions after that revision ID in the above calculation.

Returns
int|null The revision ID, or null if none is found

Definition at line 172 of file RevTagStore.php.

◆ isRevIdFuzzy()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::isRevIdFuzzy ( int $articleId,
int $revisionId )

Definition at line 144 of file RevTagStore.php.

◆ removeTags()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::removeTags ( PageIdentity $identity,
string ... $tag )

Definition at line 124 of file RevTagStore.php.

◆ replaceTag()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::replaceTag ( PageIdentity $identity,
string $tag,
int $revisionId,
?array $value = null )

Add tag for the given revisionId, while deleting it from others.

Definition at line 38 of file RevTagStore.php.

◆ setTransver()

MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::setTransver ( PageIdentity $identity,
int $translationRevision,
int $transver )

Sets the tp:transver revtag of the given page/revision.

This normally represents the last time a non-fuzzy translation was saved (presumably the version whose translation the translation is). and is used to determine whether the translation is outdated and to show a diff of the original message if it is.

Returns
int|null The revision ID, or null if none is found

Definition at line 205 of file RevTagStore.php.

Member Data Documentation

◆ FUZZY_TAG

const MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::FUZZY_TAG = 'fuzzy'

Indicates that a translation is fuzzy (outdated or not passing validation).

Definition at line 20 of file RevTagStore.php.

◆ MB_VALID_TAG

const MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::MB_VALID_TAG = 'mb:valid'

Indicates a revision of a page that is a valid message bundle.

Definition at line 28 of file RevTagStore.php.

◆ TP_MARK_TAG

const MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::TP_MARK_TAG = 'tp:mark'

Indicates a revision of a page that can be marked for translation.

Definition at line 24 of file RevTagStore.php.

◆ TP_READY_TAG

const MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::TP_READY_TAG = 'tp:tag'

Indicates a revision of a translatable page that is marked for translation.

Definition at line 26 of file RevTagStore.php.

◆ TRANSVER_PROP

const MediaWiki\Extension\Translate\MessageGroupProcessing\RevTagStore::TRANSVER_PROP = 'tp:transver'

Stores the revision id of the corresponding source text.

Used for showing diffs for outdated messages.

Definition at line 22 of file RevTagStore.php.


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