This class aims to provide efficient mechanism for fetching translation completion stats. More...
Static Public Member Functions | |
| static | getEmptyStats () |
| Returns empty stats array. | |
| static | forItem (string $groupId, string $languageCode, int $flags=0) |
| Returns stats for given group in given language. | |
| static | forLanguage (string $languageCode, int $flags=0) |
| Returns stats for all groups in given language. | |
| static | forGroup (string $groupId, int $flags=0) |
| Returns stats for all languages in given group. | |
| static | clear (MessageHandle $handle) |
| Recalculate stats for all groups associated with the message. | |
| static | clearGroup ( $id, int $flags=0) |
| Recalculate stats for given group(s). | |
| static | getApproximateLanguageStats () |
| Fetch aggregated statistics for all languages across groups. | |
| static | getLanguages () |
| Get list of supported languages for statistics. | |
| static | multiAdd (array $a, array $b) |
| static | getDatabaseIdForGroupId (string $id) |
| static | getStatsForCollection (MessageCollection $collection) |
Public Attributes | |
| const | TOTAL = 0 |
| Array index. | |
| const | TRANSLATED = 1 |
| Array index. | |
| const | FUZZY = 2 |
| Array index. | |
| const | PROOFREAD = 3 |
| Array index. | |
| const | FLAG_CACHE_ONLY = 1 |
| If stats are not cached, do not attempt to calculate them on the fly. | |
| const | FLAG_NO_CACHE = 2 |
| Ignore cached values. | |
| const | FLAG_IMMEDIATE_WRITES = 4 |
| Do not defer updates. | |
This class aims to provide efficient mechanism for fetching translation completion stats.
It abstracts MessageGroup statistics calculation and storing. You can access stats easily per language or per group. Stat array for each item is of format array( total, translate, fuzzy ).
Definition at line 34 of file MessageGroupStats.php.
|
static |
Recalculate stats for all groups associated with the message.
Hook: TranslateEventTranslationReview
Definition at line 164 of file MessageGroupStats.php.
|
static |
Recalculate stats for given group(s).
| string | string[] | $id | Message group ids. |
| int | $flags | Combination of FLAG_* constants. |
Definition at line 179 of file MessageGroupStats.php.
|
static |
Returns stats for all languages in given group.
| string | $groupId | |
| int | $flags | Combination of FLAG_* constants. |
Definition at line 146 of file MessageGroupStats.php.
|
static |
Returns stats for given group in given language.
| string | $groupId | |
| string | $languageCode | |
| int | $flags | Combination of FLAG_* constants. |
Definition at line 93 of file MessageGroupStats.php.
|
static |
Returns stats for all groups in given language.
| string | $languageCode | |
| int | $flags | Combination of FLAG_* constants. |
Definition at line 117 of file MessageGroupStats.php.
|
static |
Fetch aggregated statistics for all languages across groups.
The stats are cached in the WANObjectCache, and recalculated on the fly if the values are stale. The statistics may lag behind the actuals due to extra and missing values
Definition at line 195 of file MessageGroupStats.php.
|
static |
Definition at line 655 of file MessageGroupStats.php.
|
static |
Returns empty stats array.
Useful because the number of elements may change.
Definition at line 61 of file MessageGroupStats.php.
|
static |
Get list of supported languages for statistics.
Definition at line 292 of file MessageGroupStats.php.
|
static |
Definition at line 666 of file MessageGroupStats.php.
|
static |
Definition at line 547 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::FLAG_CACHE_ONLY = 1 |
If stats are not cached, do not attempt to calculate them on the fly.
Definition at line 46 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::FLAG_IMMEDIATE_WRITES = 4 |
Do not defer updates.
Meant for jobs like RebuildMessageGroupStatsJob.
Definition at line 50 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::FLAG_NO_CACHE = 2 |
Ignore cached values.
Useful for updating stale values.
Definition at line 48 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::FUZZY = 2 |
Array index.
Definition at line 42 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::PROOFREAD = 3 |
Array index.
Definition at line 43 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::TOTAL = 0 |
Array index.
Definition at line 40 of file MessageGroupStats.php.
| const MediaWiki\Extension\Translate\Statistics\MessageGroupStats::TRANSLATED = 1 |
Array index.
Definition at line 41 of file MessageGroupStats.php.