We have a number of simple multi-language sites. There are few pages, and we like to keep the directory structure as flat as possible. Language-code appended files fit perfect for this project! (index.md, index.es.md, index.ru.md, etc.)
We add additional translations, and image translation on a per-needed basis, and rarely do “full-site translations” as that gets expensive, and largely unnecessary. So if I add a Spanish version of example.svg (example.es.svg), ideally it would get renamed to example.svg during publish, but that is not happening.
structure
content/
├── about/
│ ├── a-global-example.svg
│ ├── example.es.svg
│ ├── example.svg
│ ├── index.es.md
│ └── index.md
└── _index.md
config.toml
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = false
index.es.md
+++
slug = "acerca"
+++
renders
public/
├── about/
│ ├── a-global-example.svg
│ ├── example.svg
│ └── index.html
├── es/
│ └── acerca/
│ ├── a-global-example.svg
│ ├── example.es.svg ⬅️
│ └── index.html
└── index.html
Wouldn’t it make sense in this case for Hugo to rename example.es.svg to example.svg? That seems intuitive, and kind of a missed opportunity IMHO.
Quoting Multilingual mode | Hugo
Page Bundle resources follow the same language assignment logic as content files, both by filename (
image.jpg
,image.fr.jpg
) and by directory (english/about/header.jpg
,french/about/header.jpg
).
Which is talking about language assignment inheritance, (which it accurately does do), but doesn’t rename, like perhaps it should.
Any thoughts regarding this?
I understand at this point I will likely have to either 1) Split languages into different contentDir’s
or 2) Utilize [[module.mounts]] and have translated content inherit that way.