jkumar
1
I have a problem or maybe did not get it how the multilanguage works.
I would like to create a structure for each language and also use the correct name of the directory.
my structure now is:
content/
content/index.en.md
content/index.de.md
content/about/
content/about/index.en.md
content/about/index.de.md
would it be able to use content/{en,de...}/
and insert there the correct folders and the translated files? like
content/en/index.md
content/en/about/index.md
content/de/index.md
content/de/about/index.md
content/index.md
content/about/index.md
and inside the file can we tell the layout file?
maiki
2
Did you try defaultContentLanguageInSubdir
? The multilingual doc says:
If you want all of the languages to be put below their respective language code, enable defaultContentLanguageInSubdir: true
.
jkumar
3
If we use defaultContentLanguageInSubdir: true
all the files will fall under the folder with the name mentioned in defaultContentLanguage.
But here I want to have different folder structure is possible? Instead of writing content/index.fr.md
, want to use content/fr/index.md
.
maiki
4
Ah! Nope, that doesn’t work with the multilingual system in Hugo. The translation section mentions:
Translated articles are identified by the name of the content file.