Add a loader that will generate localization messages.

@param \Decoda\Loader $loader
@return \Decoda\Decoda
342881
public function addMessages(Loader $loader) {
        $loader->setParser($this);

        if ($messages = $loader->load()) {
            foreach ($messages as $locale => $strings) {
                if (!empty($this->_messages[$locale])) {
                    $strings = array_merge($this->_messages[$locale], $strings);
                }

                $this->_messages[$locale] = $strings;
            }
        }

        return $this;
    }
235621
protected function registerLoader()
    {
        // to Translator
        $this->app->singleton('translation.loader', function ($app) {
            return new FileLoader($app['files'], $app['path.lang']);
        });

        // to Jargon
        $this->app->singleton('jargon.loader', function ($app) {
            return new FileLoader($app['files'], $app['path.jargon']);
        });
    }
740515
public function setPluginLoader($type, $loader)
    {
        $type       = $this->_validateLoaderType($type);

        if (is_string($loader)) {
            if (!class_exists($loader)) {

                Zend_Loader::loadClass($loader);
            }
            $loader = new $loader();
        } elseif (!is_object($loader)) {

            throw new Zend_Http_UserAgent_Exception(sprintf(
                'Expected a plugin loader class or object; received %s',
                gettype($loader)
            ));
        }
        if (!$loader instanceof Zend_Loader_PluginLoader) {

            throw new Zend_Http_UserAgent_Exception(sprintf(
                'Expected an object extending Zend_Loader_PluginLoader; received %s',
                get_class($loader)
            ));
        }

        $basePrefix = 'Zend_Http_UserAgent_';
        $basePath   = 'Zend/Http/UserAgent/';
        switch ($type) {
            case 'storage':
                $prefix = $basePrefix . 'Storage';
                $path   = $basePath   . 'Storage';
                break;
            case 'device':
                $prefix = $basePrefix;
                $path   = $basePath;
                break;
        }
        $loader->addPrefixPath($prefix, $path);
        $this->_loaders[$type] = $loader;
        return $this;
    }
64026
protected function executeLoader(LoaderInterface $loader)
    {
        $offset = 0;

        try {

            while ($result = $loader->load($this->limit, $offset)) {

                $this->persist($result);
                $offset += $this->limit;
            }

        } catch (LoaderException $e) {
            $this->getLogger()->error($e->getMessage());
        }
    }
738693
public function getLoader()
    {
        if (!($this->loader instanceof DictLoaderInterface)) {
            $dataDir = dirname(__DIR__).'/data/';

            $loaderName = $this->loader;
            $this->loader = new $loaderName($dataDir);
        }

        return $this->loader;
    }
1304517
protected function registerLoader()
    {
        $this->app->singleton('translation.loader', function (Application $app) {
            $defaultLocale = $app->getLocale();
            $cacheTimeout = config('translator.cache.timeout', 60);

            $laravelFileLoader = new LaravelFileLoader($app['files'], base_path('/resources/lang'));
            $fileLoader = new FileLoader($defaultLocale, $laravelFileLoader);
            $databaseLoader = new DatabaseLoader($defaultLocale, $app->make(TranslationRepository::class));
            $loader = new MixedLoader($defaultLocale, $databaseLoader, $fileLoader);

            return new CacheLoader($defaultLocale, $app['translation.cache.repository'], $loader, $cacheTimeout);
        });
    }
828739
private function createLoaderReferences(array $loaders): array
    {
        return array_combine($loaders, array_map(function ($name) {
            return new Reference(sprintf('liip_imagine.binary.loader.%s', $name));
        }, $loaders));
    }
1088470
public function setLoaderFallback($name, callable $loader)
    {
        $fallbackDomain = 'default';
        if (!$this->_useFallback || $name === $fallbackDomain) {
            return $loader;
        }
        $loader = function () use ($loader, $fallbackDomain) {
            /* @var \Aura\Intl\Package $package */
            $package = $loader();
            if (!$package->getFallback()) {
                $package->setFallback($fallbackDomain);
            }

            return $package;
        };

        return $loader;
    }
823621
protected function registerLoader()
    {
        $this->app->singleton('translation.loader', function (Application $app) {
            $repository = new EloquentTranslation();

            return new MixedLoader($app['files'], $app['path.lang'], $repository);
        });
    }
1157374
public function addLoaders(array $loaders) {
        foreach ($loaders as $loader) {
            if (is_string($loader)) {
                $loader = new $loader();
            }

            if (!$loader instanceof InputLoaderInterface) {
                $name = is_object($loader) ? get_class($loader) : (string) $loader;
                throw new InvalidArgumentException('Given loader (' . $name . ') does not implement LoaderInterface', 500);
            }

            $this->registerLoader($loader);
        }

        return $this;
    }
633087
protected function _loadMessages() {
        foreach ($this->getPaths() as $path) {
            foreach (glob($path . 'messages.*') as $file) {
                $this->addMessages(new \Decoda\Loader\FileLoader($file));
            }
        }
    }
592841
private function getLoader(): LoaderInterface
    {
        if (null !== $this->loader) {
            return $this->loader;
        }

        if (null !== $this->localFile) {
            $this->loader = new Local($this->localFile);

            return $this->loader;
        }

        if (extension_loaded('curl')) {
            $this->loader = new Curl($this);

            return $this->loader;
        }

        $streamHelper = new StreamCreator($this);

        if (ini_get('allow_url_fopen')) {
            $this->loader = new FopenLoader($this, $streamHelper);

            return $this->loader;
        }

        $this->loader = new SocketLoader($this, $streamHelper);

        return $this->loader;
    }
1274309
public static function load()
    {
        if (is_null(self::$loader)) {
            // Create loader object
            self::$loader = new \PhpMyAdmin\MoTranslator\Loader();

            // Set locale
            self::$loader->setlocale(
                self::$loader->detectlocale()
            );

            // Set default text domain
            self::$loader->textdomain('sqlparser');

            // Set path where to look for a domain
            self::$loader->bindtextdomain('sqlparser', __DIR__ . '/../locale/');
        }

        if (is_null(self::$translator)) {
            // Get translator
            self::$translator = self::$loader->getTranslator();
        }
    }
1199912
public function registerLoader(LoaderInterface $loader, $id = null) {
		if ($id === null) {
			$this->_loaders[] = $loader;
		} else if (! isset($this->_loaders[$id])) {
			$this->_loaders[$id] = $loader;
		}
		
		if ($loader instanceof LocatorAwareInterface && ! $loader->hasLocator() && $this->hasLocator()) {
			$loader->setLocator($this->getLocator());
		}
		
		return $this;
	}
643584
public function createTwigEnvironment(
        TwigConfig $config,
        TwigLoader $loader
    ) {
        return new Twig($loader, $this->buildTwigEnvironmentOptions($config));
    }
838235
public function load( $loader ) {
		if ( ! empty( $this->configs['libraryDir'] ) ) {
			$library = $this->configs['libraryDir'] . 'src/Library';

			// Only create a single instance of the BoldGrid Library Start.
			if ( did_action( 'Boldgrid\Library\Library\Start' ) === 0 ) {
				do_action( 'Boldgrid\Library\Library\Start', $library );

				// Check dir and add PSR-4 dir of the BoldGrid Library to autoload.
				if ( is_dir( $library ) ) {
					$loader->addPsr4( 'Boldgrid\\Library\\Library\\', $library );
					$load = new \Boldgrid\Library\Library\Start( $this->configs );
					$load->init();
				}
			}
		}
	}
603168
public function loader(callable $loader, string ...$types): BuilderInterface
    {
        $this->resolver->loader($loader, ...$types);

        return $this;
    }