Add static function for getting a sorted, translated list of event types

This commit is contained in:
Joshua Ramon Enslin 2020-08-06 17:57:38 +02:00 committed by Stefan Rohde-Enslin
parent 96c562efd3
commit d4557c8cbd
2 changed files with 20 additions and 1 deletions

2
l18n

@ -1 +1 @@
Subproject commit d62d3eb5b774740b6ceeec45a13eccf6be5fae60 Subproject commit 8d4634f65fe004899fd054001cc1d10d62d5c0d6

View File

@ -49,4 +49,23 @@ class MDEventsSet {
'38', // => Illustrated '38', // => Illustrated
]; ];
/**
* Gets a list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
$output = [];
foreach (self::EVENT_IDS as $tID) {
$output[$tID] = $tlLoader->tl("eventtype_name", "eventname", $tID);
}
asort($eventTypes);
return $output;
}
} }