Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

back to same page after changing locale

@php
    $thisUrl = url()->current().'/';
    if (app()->getlocale() == 'en') {
        $newUrl  = str_replace('/en/', '/it/', $thisUrl);
    }else{
        $newUrl  = str_replace('/it/', '/en/', $thisUrl);
    }
 @endphp
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #page #changing #locale
ADD COMMENT
Topic
Name
7+8 =