private function findAvailableChildLocalization(array $availableLocales, Localization $localization)
    {
        $childrenLocalizations = $localization->getChildren();

        if (!empty($childrenLocalizations)) {
            foreach ($childrenLocalizations as $childrenLocalization) {
                // return the localization if a translation exists in the child localization
                if (in_array($childrenLocalization->getLocale(), $availableLocales)) {
                    return $childrenLocalization;
                }

                // recursively call this function for checking children
                return $this->findAvailableChildLocalization($availableLocales, $childrenLocalization);
            }
        }

        // return null if nothing was found
        return;
    }