<commit_before><?php

namespace Kunstmaan\ArticleBundle\Router;

use Kunstmaan\NodeBundle\Router\SlugRouter;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\VarDumper\VarDumper;

class TagCategoryRouter extends SlugRouter
{
    /**
     * @return \Symfony\Component\Routing\RouteCollection
     */
    public function getRouteCollection()
    {
        if (! is_null($this->routeCollection)) {
            return $this->routeCollection;
        }
        $this->routeCollection = new RouteCollection();

        $extendParameters = array('category' => null, 'tag' => null);
        $baseSlugParameters = array_merge($this->getSlugRouteParameters(), $extendParameters);
        $baseSlugPreviewParameters = array_merge($this->getPreviewRouteParameters(), $extendParameters);

        /** @var TranslatorInterface $translator */
        $translator = $this->container->get('translator');

        if ($this->isMultiLanguage()) {
            foreach ($this->getFrontendLocales() as $locale) {
                $translator->setLocale($locale);
                $categoryTrans = $translator->trans('article_overview_page.route.category');
                $tagTrans = $translator->trans('article_overview_page.route.tag');

                $routePathParts = array(
                    '_slug_category_tag' => sprintf('/%s/{category}/%s/{tag}', $categoryTrans, $tagTrans),
                    '_slug_tag' => sprintf('/%s/{tag}', $tagTrans),<commit_msg>[GeneratorBundle]: set correct path for article detail (#1860)<commit_after><?php

namespace Kunstmaan\ArticleBundle\Router;

use Kunstmaan\NodeBundle\Router\SlugRouter;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\VarDumper\VarDumper;

class TagCategoryRouter extends SlugRouter
{
    /**
     * @return \Symfony\Component\Routing\RouteCollection
     */
    public function getRouteCollection()
    {
        if (! is_null($this->routeCollection)) {
            return $this->routeCollection;
        }
        $this->routeCollection = new RouteCollection();

        $extendParameters = array('category' => null, 'tag' => null);
        $baseSlugParameters = array_merge($this->getSlugRouteParameters(), $extendParameters);
        $baseSlugPreviewParameters = array_merge($this->getPreviewRouteParameters(), $extendParameters);

        /** @var TranslatorInterface $translator */
        $translator = $this->container->get('translator');

        if ($this->isMultiLanguage()) {
            foreach ($this->getFrontendLocales() as $locale) {
                $categoryTrans = $translator->trans('article_overview_page.route.category', [], null, $locale);
                $tagTrans = $translator->trans('article_overview_page.route.tag', [], null, $locale);

                $routePathParts = array(
                    '_slug_category_tag' => sprintf('/%s/{category}/%s/{tag}', $categoryTrans, $tagTrans),
                    '_slug_tag' => sprintf('/%s/{tag}', $tagTrans),
{'fraction_non_alphanumeric': 0.13746031746031745, 'fraction_numerical': 0.0012698412698412698, 'mean_word_length': 3.3522099447513813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7631206', 'n_tokens_mistral': 859, 'n_tokens_neox': 850, 'n_words': 139}