[SOLVED] Help to understand content translation

Goodmorning everyone,

I’m setting up a small personal blog in Hugo, for now is only in italian but I would like to make the default language english with italian translation.

I’m having an hard time to understand how translation works in Hugo, I read the doc and tried to implement an it/ and en/ directory with the same content (I will change it later) and I tried to make a test.md in english and put that in both directories, in this case italian translation didn’t work.

My hugo.toml:

baseURL = "https://lorenzocesana.xyz/"
languageCode = "en-us"

title = "Lorenzo Cesana's Website"
theme = 'lugo'

        email = "lorenzo@lorenzocesana.xyz"

defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true
  contentDir = 'content/en'
  disabled = false
  languageCode = 'en-US'
  languageDirection = 'ltr'
  languageName = "English"
  weight = 1

  contentDir = 'content/it'
  disabled = false
  languageCode = 'it-IT'
  languageDirection = 'ltr'
  languageName = "Italian"
  weight = 2

Of course I’m getting something wrong here, could someone help me understand?

Many thanks in advance

What does this mean?

Your site configuration looks fine.

1 Like

I mean that I created a new page in content/en called “test.md” and I wrote inside something like “Test for english translation”; copied that into content/it and the content was still “Test for english translation” (in english).

As I said I think I’m missing something, maybe I have to tell in some way(?) to the it page that it needed to be traslated from english?

With this config, are those the correct steps to create a page and automatically translate it?

Thanks for the reply (and sorry for my late one)

Yeah, so, you need to translate the content yourself.

You can use translation tables for words in your templates.


I was hoping for some magic trick that allowed me to automatically translate pages, guess I have to script something myself.

Many thanks for clearing this out for me!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.