Changeset View
Changeset View
Standalone View
Standalone View
src/internationalization/PhutilTranslation.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | abstract class PhutilTranslation extends Phobject { | ||||
| /** | /** | ||||
| * Load all available translation objects. | * Load all available translation objects. | ||||
| * | * | ||||
| * @return list<PhutilTranslation> List of available translation sources. | * @return list<PhutilTranslation> List of available translation sources. | ||||
| */ | */ | ||||
| public static function loadAllTranslations() { | public static function loadAllTranslations() { | ||||
| static $translations; | return id(new PhutilClassMapQuery()) | ||||
| if ($translations === null) { | |||||
| $translations = id(new PhutilSymbolLoader()) | |||||
| ->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
| ->loadObjects(); | ->execute(); | ||||
| } | |||||
| return $translations; | |||||
| } | } | ||||
| /** | /** | ||||
| * Load the complete translation map for a locale. | * Load the complete translation map for a locale. | ||||
| * | * | ||||
| * This will compile primary and fallback translations into a single | * This will compile primary and fallback translations into a single | ||||
| * translation map. | * translation map. | ||||
| Show All 25 Lines | |||||