That might well be, but for $page->content('en')
etc. to work, you need to define the translations.
Example (shortened):
<?php
class MembersPage extends Page
{
public function children()
{
$usersPages = [];
$users = kirby()->users();
foreach ($users as $key => $user) {
$content = [
'title' => $user->username(),
'role' => $user->role(),
];
$contentEn = [
'about' => $user->content('en')->about(),
'dates' => $user->content('en')->dates()->yaml(),
];
$contentDe = [
'about' => $user->content('de')->about(),
'dates' => $user->content('de')->dates()->yaml(),
];
$userPages[] = [
'slug' => Str::slug($user->username()),
'num' => $user->indexOf($users),
'template' => 'member',
'model' => 'member',
'content' => array_merge($content, $contentEn),
'translations' => [
'de' => [
'code' => 'de',
'content' => array_merge($content, $contentDe),
],
'en' => [
'code' => 'en',
'content' => array_merge($content, $contentEn),
],
]
];
}
return Pages::factory($userPages, $this);
}
}