summaryrefslogtreecommitdiff
blob: dbf32a9a26b858f1eb5a58a48c96443fccfa92eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
 * This file contains a class to load the WorkflowStatesMessageGroup.
 *
 * @file
 * @author Abijeet Patro
 * @license GPL-2.0-or-later
 */

/**
 * Loads WorkflowStatesMessageGroup, and handles the related cache.
 * @since 2019.05
 */
class WorkflowStatesMessageGroupLoader extends MessageGroupLoader {
	/**
	 * Fetches configured WorkflowStatesMessageGroup
	 *
	 * @return WorkflowStatesMessageGroup[]
	 */
	public function getGroups() {
		global $wgTranslateWorkflowStates;
		$groups = [];
		if ( $wgTranslateWorkflowStates ) {
			$groups['translate-workflow-states'] = new WorkflowStatesMessageGroup();
		}

		return $groups;
	}

	/**
	 * Hook: TranslateInitGroupLoaders
	 *
	 * @param array &$groupLoader
	 * @param array $deps
	 */
	public static function registerLoader( array &$groupLoader, array $deps ) {
		$groupLoader[] = new self();
	}
}