Skip to content

Suggestions to persist the last chosen active locale? #18

Answered by atmonshi
cawecoy asked this question in Q&A
Discussion options

You must be logged in to vote

hi.
so since the activeLocal is on the class level (create/edit/list), the only way I can think of is to override the action LocaleSwitcher
and set the view to custom view. then use alpine Persist Plugin. or store it on a session somehow!

then in the resource you can set:

public static function getDefaultTranslatableLocale(): string
{
    return session('activeLocal');
}

I am just thinking out loud :) not sure if it will fully works, but this a starting point.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cawecoy
Comment options

Answer selected by cawecoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants