<commit_before><?php

declare(strict_types=1);

use Spatie\Menu\Laravel\Link;
use Cortex\Foundation\Models\Menu as MenuModel;

if (config('cortex.foundation.route.locale_prefix')) {
    $langSwitcherHeader = Link::to('#', '<span class="fa fa-globe"></span> '.app('laravellocalization')->getCurrentLocaleNative().' <span class="caret"></span>')->addClass('dropdown-toggle')->setAttribute('data-toggle', 'dropdown');
    $langSwitcherBody = function (MenuModel $menu) {
        $menu->addClass('dropdown-menu');
        $menu->addParentClass('dropdown');
        foreach (app('laravellocalization')->getSupportedLocales() as $key => $locale) {
            $menu->url(app('laravellocalization')->localizeURL(request()->fullUrl(), $key), $locale['name']);
        }
    };

    Menu::adminareaTopbar()->submenu($langSwitcherHeader, $langSwitcherBody);
}<commit_msg>Add language switcher to guestarea & memberarea<commit_after><?php

declare(strict_types=1);

use Spatie\Menu\Laravel\Link;
use Cortex\Foundation\Models\Menu as MenuModel;

if (config('cortex.foundation.route.locale_prefix')) {
    $langSwitcherHeader = Link::to('#', '<span class="fa fa-globe"></span> '.app('laravellocalization')->getCurrentLocaleNative().' <span class="caret"></span>')->addClass('dropdown-toggle')->setAttribute('data-toggle', 'dropdown');
    $langSwitcherBody = function (MenuModel $menu) {
        $menu->addClass('dropdown-menu');
        $menu->addParentClass('dropdown');
        foreach (app('laravellocalization')->getSupportedLocales() as $key => $locale) {
            $menu->url(app('laravellocalization')->localizeURL(request()->fullUrl(), $key), $locale['name']);
        }
    };

    Menu::adminareaTopbar()->submenu($langSwitcherHeader, $langSwitcherBody);
    Menu::memberareaTopbar()->submenu($langSwitcherHeader, $langSwitcherBody);
    Menu::guestareaTopbar()->submenu($langSwitcherHeader, $langSwitcherBody);
}
{'fraction_non_alphanumeric': 0.18870883429168844, 'fraction_numerical': 0.0010454783063251437, 'mean_word_length': 5.622837370242214, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 35, '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': '7272833', 'n_tokens_mistral': 575, 'n_tokens_neox': 583, 'n_words': 79}