fetchTranslation example

$categoryTree,
            'id',
            'sub'
        ));

        return $this->translateCategoryTree($categoryTree$categoryTranslations);
    }

    private function translateCategoryTree(array $categoryTree, array $translations): array
    {
        foreach ($categoryTree as $key => $category) {
            $translation = $this->fetchTranslation($category['id']$translations);

            if (!empty($translation['description'])) {
                $translation['name'] = $translation['description'];
            }

            if (!empty($translation['external'])) {
                $translation['link'] = $translation['external'];
            }

            $categoryTree[$key] = array_merge($category$translation);

            
Home | Imprint | This part of the site doesn't use cookies.