protected function setLocale($langCode)
    {
        $translator = $this->translator();
        $translator->setLocale($langCode);

        $available = $translator->locales();
        $fallbacks = $translator->getFallbackLocales();

        array_unshift($fallbacks, $langCode);
        $fallbacks = array_unique($fallbacks);

        $locales = [];
        foreach ($fallbacks as $code) {
            if (isset($available[$code])) {
                $locale = $available[$code];
                if (isset($locale['locales'])) {
                    $choices = (array)$locale['locales'];
                    array_push($locales, ...$choices);
                } elseif (isset($locale['locale'])) {
                    array_push($locales, $locale['locale']);
                }
            }
        }

        $locales = array_unique($locales);

        if ($locales) {
            setlocale(LC_ALL, $locales);
        }
    }