Single page language preservation

Permalink
On my multilingual website I have now created my first single page named UserDetails with path application/single_pages/user/details for user then to insert the full name, address etc. in a separate users table.

When that single page is now entered, the previously selected Norwegian language is gone, and the default English is presented to the user.

How to let the previously selected Norwegian language be preserved and presented to user when user now enter this single page?

Janks
View Replies:
shahroq replied on at Permalink Reply
shahroq
Appending this piece to your page should produce the expected result:
$loc = \Localization::getInstance();
$loc->setLocale('en_US');

Just don't forget to replace the English Locale Code, 'en_US', with that of Norwegian.
Janks replied on at Permalink Reply
Janks
Is there no chance to let the single page application/single_pages/user/details utilize the language previously selected at the home page, before navigating to that single page? That means, to let this single page utilize the language previously selected like the 2 standard single pages login and register do?

Is there a chance alternatively to let this single page application/single_pages/user/details utilize the middleware usage?

The version is the latest one ie. 8.4.4.