Hi There,
I’m trying something close to what’s described here : Language variables | Kirby CMS
I can’t figure out how to access $site object in a plugin function as i would get a result similar to :
site/plugins/gdt-translations/index.php :
function getVariables() {
return kirby()->site()->content()->translations()->toObject()->toArray();
}
site/languages/fr.php :
return [
'code' => 'fr',
'default' => true,
'direction' => 'ltr',
'locale' => [
'LC_ALL' => 'fr_FR'
],
'name' => 'French',
'translations' => getVariables(),
'url' => NULL
];
Actually it results in infinite loading…
Thanks for your help !