I want untranslated pages to return a 404 instead of returning blank content

My content directory:

content/
|----------_index.md
|----------fr/

If _index.md isn’t translated to French, then I would want visiting /fr/ to return a 404 error, but I instead get blank content.

hugo.yaml:

languages:
  en:
    contentDir: content
    languageCode: en-US
    languageName: English
    weight: 1
  fr:
    contentDir: content/fr
    languageName: Français
    weight: 2

I am using the Anubis theme: GitHub - Mitrichius/hugo-theme-anubis: Anubis is a simple minimalist theme for Hugo blog engine

First, get into the habit of using a unique content directory for each language. Don’t place one inside another.

defaultContentLanguage: en
defaultContentLanguageInSubdir: true

languages:
  en:
    contentDir: content/en  # unique directory
    languageCode: en-US
    languageDirection: ltr
    languageName: English
    weight: 1
  fr:
    contentDir: content/fr  # unique directory
    languageCode: fr-FR
    languageDirection: ltr
    languageName: Français
    weight: 2

Second, if you define a language, you’re going to get a home page for that language.

You can do any of the following:

  1. Create content/fr/_index.md and set draft to true

  2. Disable the language:

    languages:
      fr:
        contentDir: content/fr
        languageCode: fr-FR
        languageDirection: ltr
        languageName: Français
        weight: 2
        disabled: true
    
  3. Disable the home page kind for a given language

    languages:
      fr:
        contentDir: content/fr
        languageCode: fr-FR
        languageDirection: ltr
        languageName: Français
        weight: 2
        disableKinds:
          - home