Iād suggest to adjust your collection words and make the source field of type āCollection-Linkā and then ālinkā the related language entry from your language collection.
This automatically returns later the full entry for your word with the sub-entry of your language.
you can create custom api endpoints in which you can use the cockpit api in order to generate your own data to be returned by the api. This way you are able to combine different collections into one single api call result.
I will give you an concrete example:
To make this example work you need three collections (ājob_locationsā, ājobsā, ājob_categoriesā).
Create a file named ājobs.php" withunder /<cockpit-install-dir>/config/api (so /<cockpit-install-dir>/config/api/jobs.php) with this content:
<?php
$data = [];
foreach (['job_locations', 'jobs', 'job_categories'] as $collection_name) {
$data[$collection_name] = cockpit('collections')->find($collection_name, [
'filter' => function($doc) { // make only published entries being used
return $doc['published'];
},
'sort' => [
'_o' => 1
]
]);
}
return $data;