getLabelsFromConfig example


    private function getTranslationsConfiguration(StorefrontPluginConfiguration $configuration, Context $context): array
    {
        $systemLanguageLocale = $this->getSystemLanguageLocale($context);

        $themeConfig = $configuration->getThemeConfig();
        if (!$themeConfig) {
            return [];
        }

        $labelTranslations = $this->getLabelsFromConfig($themeConfig);
        $translations = $this->mapTranslations($labelTranslations, 'labels', $systemLanguageLocale);

        $helpTextTranslations = $this->getHelpTextsFromConfig($themeConfig);

        return array_merge_recursive(
            $translations,
            $this->mapTranslations($helpTextTranslations, 'helpTexts', $systemLanguageLocale)
        );
    }

    /** * @param array<string, mixed> $config * * @return array<string, array<string, mixed>> */
Home | Imprint | This part of the site doesn't use cookies.