Multi-lingual site: Detection of available translations for a page always returns all languages

Hi there,

we have recently migrated our website from Kirby 2 to Kirby 3.2.5 which went mostly fine so far.
One problem remains however: The behaviour of detecting the availability of page translations seems to have changed from Kirby 2 to 3. I used to test the availability with a construct like this:

if ($page->content($languageCode)->exists()) …

In Kirby 2, exists() only returned true if a content file for the requested language was available. In Kirby 3 it always returns true for all the languages the site supports in general even if there is no content file for the requested language.

So here is my question: How can I reliably detect the availability of page content for a given language in Kirby 3?

Thanks and cheers


$page->translation($code)->exists() should do the job.

Thank you. This was exactly what I was looking for.