private function findAvailableParentLocalization(array $availableLocales, Localization $localization)
    {
        do {
            if (in_array($localization->getLocale(), $availableLocales)) {
                return $localization;
            }

            // try to load parent and stop if there is no parent
            $localization = $localization->getParent();
        } while (null != $localization);

        return;
    }