public function findAvailableLocales()
    {
        // Check for needed data
        $path   = $this->getPath();
        $domain = $this->getDomain();
        if (!$path || !$domain) {
            throw new Exception("Values for 'path' and 'domain' must be set.");
        }

        // Build regular expressions for finding domains and locales
        $regexLocale  = Locale::REGEX_LOCALE;
        $regexDefault = "/^{$regexLocale}\/LC_MESSAGES\/{$domain}\.mo$/ui";
        $regexVirtual = "/^(?<virtualLocale>C)\/LC_MESSAGES\/(?<virtualDomain>{$domain}[^a-z]{$regexLocale})\.mo$/ui";

        $glob = "{$path}/*/LC_MESSAGES/{$domain}*.mo";
        foreach (glob($glob) as $parse) {
            // Strip path prefix to fit regex
            $parse = str_replace($path . '/', '', $parse);

            // Check for default or virtual localized files
            if (preg_match($regexDefault, $parse, $found) || preg_match($regexVirtual, $parse, $found)) {
                $this->addLocale($found['locale']);
                if (!empty($found['virtualLocale'])) {
                    $map = [
                        'domain' => $found['virtualDomain'],
                        'locale' => $found['virtualLocale'],
                    ];
                    $this->addMap($found['locale'], $map);
                }
            }
        }

        return $this;
    }