1

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?

Shaunak Shukla
  • 2,347
  • 2
  • 18
  • 29
ikebastuz
  • 349
  • 1
  • 5
  • 13
  • Are you trying to migrate the translations from WordPress into laravel? –  Jan 30 '18 at 09:37
  • currently 80% of functionality in javascript. but recently cliend decided to add posts and so on. He adds them using wordpress, we take them from DB using main laravel engine and showing in frontend. Hope it clears something to you. – ikebastuz Jan 30 '18 at 09:45
  • I'm not familiar with polylang but I would assume you could capture the data. Does it store the translations in a WordPress database? If so then you could create an adapter for laravel to tap into it. Just guessing here though. –  Jan 30 '18 at 09:57

0 Answers0