I’m creating a plugin that imports translated site content into the site. I know that
$page->update() can change the content for a specific language, but why
$site->update() can’t? I looked over at the Kirby core and it appears that the Site class extends the Page class, so they should behave similarly? It’s not the case, though.
I noticed that
$site->update() changes the data for the currently selected panel language, the state of which is stored under
$_SESSION['kirby_panel_lang']. So I can kind of force an update for a specific language by changing that value right before I call the
update() method. There are two problems with that:
- It doesn’t work for the default language. If I have
enas the default, change the session value to
update(), the content isn’t changed. It only works for the other two languages I currently use (
- It’s a hack…
Is there a reliable way to do this?