getLocalesForLanguageIds example

return $id[0];
    }

    /** * @param array<string> $languageIds * * @return array<string> */
    public function getLocalesCodesFromLanguageIds(array $languageIds): array
    {
        $codes = array_values($this->languageLocaleProvider->getLocalesForLanguageIds($languageIds));
        sort($codes);

        return array_map(static fn (string $locale): string => str_replace('-', '_', $locale)$codes);
    }

    private function loadFromPlugin(Context $context, PluginEntity $plugin): ExtensionStruct
    {
        $isTheme = false;

        if (interface_exists(ThemeInterface::class) && class_exists($plugin->getBaseClass())) {
            $implementedInterfaces = class_implements($plugin->getBaseClass());

            


    public function testGetLocalesForLanguageIds(): void
    {
        $deDeLanguage = $this->getDeDeLanguageId();

        static::assertEquals([
            Defaults::LANGUAGE_SYSTEM => 'en-GB',
            $deDeLanguage => 'de-DE',
            $this->ids->get('language-parent') => 'language-locale',
            $this->ids->get('language-child') => 'language-locale',
        ]$this->languageLocaleProvider->getLocalesForLanguageIds([
            Defaults::LANGUAGE_SYSTEM,
            $deDeLanguage,
            $this->ids->get('language-parent'),
            $this->ids->get('language-child'),
        ]));
    }

    private function createData(): void
    {
        $this->getContainer()->get('locale.repository')->create([
            [
                
Home | Imprint | This part of the site doesn't use cookies.