Automating Language Translations in Hugo: Any Solutions?

Hello, everyone!

In the world of automation, it doesn’t make sense to create individual .md files for each language which takes for ever as you increase the number of languages.

So, I’m wondering if anyone has found a way to make it easier. Can Hugo somehow take the /en directory and make directories for other languages using tools like Google Translate?

If you know of a solution or have thoughts on this, please share. It could save time and make multilingual content in Hugo much simpler.

Thank you.

1 Like

Not sure if lang.Merge helps.

You can also translate (DeepL or others translate APIs) your content within your workflow (e.g. GitHub action) when pushing, and then trigger a re-build workflow if changes detected.

Hi @razon

The lang merger is a fallback for example if I have for example

# content/en
about.md 
contact.md

# content/fr
about.md

Hugo will show the contact page in English in the French version of website instead of saying page doesn’t exist etc.

I have to made a website with 9 languages and have around 300+ pages and it is very time-consuming to generate .md files for each language version.

So, I am wondering if someone have a better more automated solution using machine translation to generate the required content for each language.

translating i18n files are very easy but the content directory is very time consuming. hopefully there is a better way then doing it all manual. Just need Hugo to generate these translated files once.

Thanks

Anybody? who have a working solution for this? thanks

This is not a Hugo issue. So, perhaps posting on StackOverflow or Reddit might help. For example.

1 Like

2 years later, i’m searching hard but nothing so far!

Hi there, I’ve developed a tool that uses DeepSeek to automatically translate Hugo blogs. You can find it here: GitHub - gnailcn/hugo-i18n-translator . You can directly download the executable file from the release package and start using it—please check if it meets your needs.

With this tool, you can upload your Markdown files and get translated versions in multiple languages. You just need to manually place these translated files into your Hugo project directory. However, at the moment, it doesn’t support automatically accessing and translating files directly from your Hugo “content” folder. You’ll need to upload each file individually. This is because automatic directory integration isn’t currently a priority for me, but I may add this feature in the future if time permits.

1 Like

Looks great, thanks, I will test it with the next project. In the mean time since my previous commment I developed a suite of python tools that translate my project which worked well.

Provide a solution for reference only. https://github.com/hugo-fixit/cmpt-translate