Skip to content

Multilingual - Translation by file name generate also locale content directories #204

@pliski

Description

@pliski

What is your Hugo Extended Version

hugo v0.147.9+extended+withdeploy linux/amd64 BuildDate=unknown

What is your Go Version

go version go1.24.4 linux/amd64

What is your Node.js Version

v22.11.0

What is your Operating System

Arch Linux

Check for Existing Issues

  • I have searched and found no relevant issues.

Expected Behavior

In config/_default/languages.toml I added a new language, removed the the contentDir parameter and changed the content to match the Hugo "Multilingual mode" "Translation by file name" as described in the Hugo documentation .

The generated pages should match the structure of the content.

Steps to Reproduce

1, Install hugoplate as described in the README,md
2. Change config/_default/languages.toml like:

[en]
languageName = "En"
languageCode = "en-us"
weight = 1

[fr]
languageName = "Fr"
languageCode = "fr-fr"
weight = 2
  1. Optionally create the file i18n/fr.yaml
  2. Rename content/_index.md to content/_index.en.md
  3. Create the file content/_index.fr.md
  4. Reproduce steps 4 and 5 for the rest of the content
  5. Execute pnpm dev

Code Reproduction URL

No response

Additional Information

content_tree.txt

public_tree.txt

These are the untouched language related setting in hugo.toml:

# disable language
disableLanguages = [
] # example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/
hasCJKLanguage = false #  If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
# default language
defaultContentLanguage = 'en'
# defaultContentLanguageInSubdir need to be true if you want to use the language code as a subdirectory and language specific 404 page
defaultContentLanguageInSubdir = false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions