HUGO

Multilanguage for a homepage

Does it fallback then to the original language?

I think I should create copy of the website for testing.

It is great that all content file names / links will remain. Otherwise it would begin very complicated

This has nothing to do with Hugo, but with your hosting server/service. It should detect the browser default language, and automatically serve the correct URL.

I’m testing. Hugo is so great!

Can you help me please with my config.toml
I don’t know how to set the language code “de”
[languages]
de:
languageName = German
weight = 1
en:
languageName = English
weight = 2

this produces no more errors but I still have both languages posts in my /posts/ folder

[languages]
[languages.de]
languageName = “German”
weight = 1
[languages.en]
languageName = “English”
weight = 2

Post a link to your code.

Good Morning,
I’ve tried it again today. Now it’s running :slight_smile:

TO-DO is the language switcher in the navigation bar.
edit: just the icon TO-DO. The menus are already working. It’s truly awesome!

I’ve pulled all sections in content/de/ and content/en (_index.md too).

Here’s what’s working for me:

config.toml

[languages]
[languages.de]
languageName = “German”
contentDir = “content/de”
weight = 1
[languages.en]
languageName = “English”
contentDir = “content/en”
weight = 2

Do you have a hint how to start with the language switcher?

Have a look at this discussion:

Here is another example.

Have a look here: https://www.netlify.com/docs/redirects/#geoip-and-language-based-redirects

1 Like

The canonical link is missing in each language.

There should be self canonical link of each language page too.

If the site is english, https://moodlebox.net/en/

It should be,

And the code to solve this for each language.

<link rel="canonical" href="{{ .Permalink }}">

1 Like

One more thing in your Href lang code, the country code is missing.

You can use this tool to build one, at least a rough idea. https://www.aleydasolis.com/english/international-seo-tools/hreflang-tags-generator/

Yes you’re right (and I fixed my pages :blush:), but this is a bit off-topic in this thread. Every page should have a canonical link (if SEO is important to you), not only those in multilanguage web sites.

No.

There are English speaking people in several countries, same for French and German. This way, eg. English-speaking people in France are advertised the adequate link for them.

In short: my web site does not target specific countries. And so it does not need hreflang values (see https://searchengineland.com/auditing-hreflang-annotations-common-issues-avoid-219483, Irrelevant Hreflang Values).

1 Like

Yeah it is important for each and every page. It’s a bit off topic, I agree it. But if someone takes your git repo as multi language reference, they might miss this too :slight_smile:

I was added your site as multi language site reference, and found that it’s missing.

That make sense. As you wanted the site for wider reach by doing into different languages instead of countries.

thank you very much.
I have inserted the code at layouts/partials/language-selector.html
But in the menu nothing has changed

@martignoni
I’m not on github
Can you help me here in the board please?

Ok this is a triple post about the same support request.

This is not how things work in this forum.