11use Psr\Log\LoggerInterface;
12use Wikimedia\Bcp47Code\Bcp47Code;
51 private const CACHE_SIZE = 100;
60 private bool $useLeximorph;
69 private readonly LoggerInterface $logger,
74 $this->managerCache =
new MapCacheLRU( self::CACHE_SIZE );
75 $this->providerCache =
new MapCacheLRU( self::CACHE_SIZE );
85 if ( !$this->useLeximorph ) {
90 return $this->managerCache->getWithSetCallback(
92 fn () =>
new Manager( $langCode, $this->logger )
103 if ( !$this->useLeximorph ) {
108 return $this->providerCache->getWithSetCallback(
110 fn () =>
new Provider( $langCode, $this->logger )
if(!defined('MW_SETUP_CALLBACK'))
A class containing constants representing the names of configuration variables.
const UseLeximorph
Name constant for the UseLeximorph setting, for use with Config::get()