Returns category slug

@param Locale $locale
@param string $categoryName

@return mixed|string
359041
protected function getLocaleSlug(Locale $locale, $categoryName)
    {
        $slug          = Sluggable::makeSlug($categoryName);
        $currentLocale = $this->getRequestHelper()->getCurrentLocale();
        if ($locale->getCode() != $currentLocale) {
            $slug = Sluggable::makeSlug(sprintf('%s-%s', $categoryName, $locale->getCode()));
        }

        return $slug;
    }
217495
def get_category(self, slug):
        
        try:
            return get_category_for_slug(slug)
        except ObjectDoesNotExist as e:
            raise Http404(str(e))
247017
public function getArticleCategoryRouterPath($slug, $category, $locale, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        $routeName = sprintf('_slug_category_%s', $locale);

        return $this->getArticleRouterPath($routeName, 'category', $slug, $category, $locale, $parameters, $referenceType);
    }
217056
protected function translateCategory(Locale $locale, CategoryInterface $category, $name)
    {
        /**
         * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation
         */
        $translation = $category->translate($locale->getCode());
        $slug        = $this->getLocaleSlug($locale, $name);
        $translation->setName($name);
        $translation->setSlug($slug);
        $category->mergeNewTranslations();
    }
464368
public function getRootCategory($context = null)
    {
        $context = $this->getContext($context);

        $this->loadCategories($context);

        return $this->categories[$context->getId()][0];
    }
355741
protected function getPrefix($locale)
    {
        foreach ($this->localeResolver->getDomainConfig() as $_domain => $_locale) {
            if ($_locale === $locale) {
                $urlPrefix = sprintf('%s://%s', $this->request ? $this->request->getScheme() : 'http', $_domain);
                if ($this->request && $this->request->getPort()) {
                    $urlPrefix .= ':'.$this->request->getPort();
                }

                return $urlPrefix;
            }
        }
    }
764521
private function getTranslatedName($level, $locale)
    {
        if ($locale === 'auto') {
            $locale = null;
        }

        return $this->translator->get('log-viewer::levels.' . $level, [], $locale);
    }
49204
def _category_slugs(self, category):
        """"""
        key = self._category_key(category)
        slugs = self.r.smembers(key)
        return slugs
405788
public function actionGetCategoryRouteRules(string $category, string $format = 'Craft', $siteId = null): Response
    {
        return $this->asJson(RouteMap::$plugin->routes->getCategoryRouteRules($category, $format, $siteId));
    }
1339499
private function getRealKey(string $key, string $locale = null): string
    {
        if (!$locale) {
            $locale = $this->defaultLanguage;
        }
        
        if (\strpos($key, '.') === false) {
            $key = implode([$this->defualtCategory, $key], '.');
        }

        return implode('.', [$locale, $key]);
    }
335458
function getPluralCategory(value, cases, ngLocalization) {
	        var nbCase = "=" + value;
	        return cases.indexOf(nbCase) > -1 ? nbCase : ngLocalization.getPluralCategory(value);
	    }
63453
private function getCategories(NodeInterface $node, $locale)
    {
        return $node->getPropertyValueWithDefault(
            sprintf(self::CATEGORIES_PROPERTY, $locale),
            []
        );
    }
503883
protected function getSelectedCategory($categorySlug = null)
    {
        $selectedCategory = null;

        if ($categorySlug !== null) {
            $selectedCategory = $this->getCategoryRepository()->findOneBy(array('isActive' => true, 'slug' => $categorySlug));
        }

        return $selectedCategory;
    }
731989
public function findTranslated($category, $languageId)
    {
        return CategoryTranslation::whereCategoryId($category->id)
            ->whereLanguageId($languageId)
            ->first();
    }
1308694
protected function getUrlLanguage($locale = null)
    {
        // Check if the functionality is activated
        if (!ConfigQuery::isMultiDomainActivated()) {
            return null;
        }

        // If we don't have a locale value, use the locale value in the session
        if (!$locale) {
            $locale = $this->getCurrentEditionLocale();
        }

        return LangQuery::create()->findOneByLocale($locale)->getUrl();
    }
649677
public function getCategories($id, $locale)
    {
        $groups    = $this->getGroups($id, $locale)->toArray();
        $available = antares('memory')->get('extensions.available');
        $list      = ['all' => 'All', 'foundation' => trans('Core')];

        array_walk($groups, function($item) use($available, &$list) {
            $group = str_replace('antares/', '', $item['group']);
            foreach ($available as $extension) {
                if ($group == $extension['name']) {
                    $list[$group] = $extension['full_name'];
                }
            }
        });
        $return = [
            'all'           => 'All',
            'core'          => [
                'label'      => trans('antares/translations::messages.group.core'),
                'extensions' => []
            ],
            'configuration' => [
                'label'      => trans('antares/translations::messages.group.configuration'),
                'extensions' => []
            ],
        ];
        foreach ($list as $name => $value) {
            if (in_array($name, ['foundation', 'widgets', 'search', 'control'])) {
                $return['core']['extensions'][$name] = $value;
            } elseif (in_array($name, ['two_factor_auth', 'api'])) {
                $return['configuration']['extensions'][$name] = $value;
            } else {
                $return[$name] = $value;
            }
        }
        return $return;
    }
489860
public static function getCategories($pageName) {
	    $title = Title::newFromText ( $pageName );
	    $page = new Article($title);
	    $categoriesIterator = $page->getPage()->getCategories();

	    $categories = array();
	    foreach ($categoriesIterator as $categoryTitle) {
	        $categories[] = $categoryTitle;
	    }
	    return $categories;
	}