Checking for translation of virtual page

Hey there!
I’m using this rather primitive code as page method to detect if translated pages exist, which doesn’t work with my virtual page since it’s looking for the actual file:

function isTranslated(string $language): bool {
    # Check if translation file for given language exists
    return $this->translation($language)->exists();

Did you encounter this problem, and how are you dealing with it?

Yes, you cannot use exists() here, but have to replace it depending on your model.

1 Like

That’s what I did for now - thanks!