I have a site build with Laravel 5.5, which has admin cabinet on WordPress (that was clients demand). And we were asked to add an ability to switch languages.
Tons of code in javascript and some static front-end data we already translated using the dictionary in database and session variable. Change language - change session variable - the same dictionary as a multilevel array gives us translated strings.
But we stuck to translating dynamic data from WordPress, posts, custom posts, menus. Already installed Polylang plugin. But it has its own language switcher.
We need to use same sessions for already working translations and somehow imitate polylang language switcher. Tried using pll_set_post_language and same functions, but we need to add WordPress functionality on the frontend for that, using wp-load.php, but it is conflicting with laravel (same classes, function names). Is there any way to emit polylang language change from outside of WordPress?