Content only in non-default language loads wrong template?

I have a site that uses multiple languages (english is the default) and if I have content that’s only available in german the site seems to always load the default.php template. So for example:

‘24082016-postname’ folder has a file called grid.de.txt. Instead of loading grid.php it loads default.php. However if I add a blank grid.en.txt file inside of this folder the german page loads the correct template.

Is there any way around this or do I have add these blank default language files to each page?

I think the default language file must be present. If you would use the panel, the default language file would always be created automatically.

Edit: https://getkirby.com/docs/languages/content

Ah I see. Do you think it would be possible to write some kind of check that in case of a “blank file” the visitor wouldn’t be able to see that page (maybe redirect them for example)?

This could work, not tested, though:

if(empty($page->content($site->language()->code())->toArray())) {
  go('error');
} else {
// your template code
}

Thanks, I’ll try it a bit later. This would be template specific though, right? Do you know if it would be possible to make such rule sitewide?

Right, that would be template specific. You could put the code in the header to include it in every template. Not sure if there is a better way to achieve this.