final public function parseDirectory($rootDirectory, $relativePath, $translations = null, $subParsersFilter = false, $exclude3rdParty = true)
    {
        if (!is_object($translations)) {
            $translations = new \Gettext\Translations();
        }
        $dir = (string) $rootDirectory;
        if ($dir !== '') {
            $dir = @realpath($rootDirectory);
            if (($dir === false) || (!is_dir($dir))) {
                $dir = '';
            } else {
                $dir = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $dir), '/');
            }
        }
        if ($dir === '') {
            throw new \Exception("Unable to find the directory $rootDirectory");
        }
        if (!@is_readable($dir)) {
            throw new \Exception("Directory not readable: $dir");
        }
        $dirRel = is_string($relativePath) ? trim(str_replace(DIRECTORY_SEPARATOR, '/', $relativePath), '/') : '';
        $this->parseDirectoryDo($translations, $dir, $dirRel, $subParsersFilter, $exclude3rdParty);

        return $translations;
    }