<?php

use Contao\CoreBundle\ContaoCoreBundle;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return function (RoutingConfigurator $routes): void {
    $routes
        ->import('../src/Controller/Frontend/', type: 'attribute')
        ->defaults(['_scope' => ContaoCoreBundle::SCOPE_FRONTEND])
    ;
    $routes
        ->import('../src/Controller/FlashMessageController.php', type: 'attribute')
        ->defaults(['_scope' => ContaoCoreBundle::SCOPE_FRONTEND])
    ;
    $routes
        ->import('../src/Controller/Page/', type: 'attribute')
        ->prefix([
            'de' => '',
            'nl' => '/nl',
            'en' => '/en',
            'ar' => '/ar',
            'ru' => '/ru',
            'uk' => '/uk',
            'tr' => '/tr',
            'pl' => '/pl',
            'sq' => '/sq',
            'ku' => '/ku',
            'es' => '/es',
            'fr' => '/fr',
            'pt' => '/pt',
            'sw' => '/sw',
            'prs' => '/prs',
            'zh' => '/zh',
            'sr' => '/sr',
            'hr' => '/hr',
            'bs' => '/bs',
        ])
        ->defaults(['_scope' => ContaoCoreBundle::SCOPE_FRONTEND])
    ;

    $routes->add('live_component_cms', '/{_locale}/_contao/_components/{_live_component}/{_live_action}')
        ->defaults(['_live_action' => 'get', '_scope' => 'frontend', '_token_check' => false])
    ;
};
