Kdyby\Translation\TranslationLoader::loadMessages PHP Method

loadMessages() public method

Loads translation messages from a directory to the catalogue.
public loadMessages ( string $directory, Symfony\Component\Translation\MessageCatalogue $catalogue )
$directory string the directory to look into
$catalogue Symfony\Component\Translation\MessageCatalogue the catalogue
    public function loadMessages($directory, MessageCatalogue $catalogue)
    {
        foreach ($this->getLoaders() as $format => $loader) {
            // load any existing translation files
            $extension = $catalogue->getLocale() . '.' . $format;
            foreach (Finder::findFiles('*.' . $extension)->from($directory) as $file) {
                /** @var \SplFileInfo $file */
                $domain = substr($file->getFileName(), 0, -1 * strlen($extension) - 1);
                $this->loadResource($format, $file->getPathname(), $domain, $catalogue);
            }
        }
    }