Some links in my menu links change the language

The main language of my blog is in pt-br (Brazilian Portuguese). Since I only/ want to support one other language, I thought adding a menu link to English would suffice. However, some menu links don’t work as I expect.

For example, I’ll open the page and click “English version”. Everything under /posts/, /about/ and /license/ works. I am unable to change the language back to Portuguese by clicking “Versão em português”. The other problem is that if I click at the “Home” menu link or the link in the profile picture, I’ll go back to the main language, when the expected behavior is that I would go back to the homepage of that specific language.

Here’s the repo: GitHub - Tetizera/temporary-repo-jwaghelli

Here’s the relevant section in the config.toml file:

[languages]
  [languages.pt-br]
    description = "Olá! :)"
    languageName = "Brazilian Portuguese"
    languageCode = "pt-br"
    title = 'Blog do Tet'
    weight = 10
    [languages.pt-br.menu]
  
[[languages.pt-br.menu.main]]
      url = '/'
      weight = 0

[[languages.pt-br.menu.main]]
identifier = "posts"
name       = "Posts"
url        = "/posts/"
weight     = 10

[[languages.pt-br.menu.main]]
identifier = "Sobre"
name       = "Sobre"
url        = "/about/"
weight     = 30

[[languages.pt-br.menu.main]]
identifier = "Licença"
name       = "Licença"
url        = "/licença/"
weight     = 40

[[languages.pt-br.menu.main]]
identifier = "versão en"
name       = "English version"
url        = "en"
weight     = 50


  [languages.en]
    description = "Hi! :)"
    weight = 0
    title = "Tet's Blog"
    languageCode = "en"
    languageName = "English"
    [languages.en.menu]

[[languages.en.menu.main]]
      title = 'Tet Blog'
      url = '/en/'
      weight = 0

[[languages.en.menu.main]]
identifier = "posts"
name       = "Posts"
url        = "/en/"
weight     = 10

[[languages.en.menu.main]]
identifier = "About"
name       = "About"
url        = "/about/"
weight     = 30

[[languages.en.menu.main]]
identifier = "License"
name       = "License"
url        = "/licença/"
weight     = 40

[[languages.en.menu.main]]
identifier = "pt-br version"
name       = "Versão em Português"
url        = "/"
weight     = 50

The URL in each menu property is resolved relative to the current language, so a language switcher as a menu item will not work.

Using something like /en/ doesn’t make any sense either.

I named the repo because of this guy: https://waghetti.com/

He uses a similar theme, but I couldn’t find any different between my theme (soho), and his: GitHub - jwaghetti/j-hyde: A cool theme inspired by spf13's Hyde theme

So I just assumed jwaghetti is using menu buttons. I actually forgot to also send him an e-mail asking about this. I may update this post if I find the solution with his help.

jwagletti provided me with his config.toml file so I could get an idea of what to do. The changes I did are described on Github, but I’m going to describe what changes I did to config.toml to get what I wanted.

[languages]
[languages.pt-br]
description = “Descrição no idioma settado em defaultContentLanguage”
languageName = “Português do Brasil”
weight = 5
[languages.en]
description = “Description text in the sidebar in English”
languageName = “English”
weight = 10

[languages.pt-br.Menus]
main = [
{ Name = “Posts”, URL = “/”, weight = 5 },
{ Name = “Sobre Mim”, URL = “/about/”, weight = 10 },
{ Name = “Versão em Inglês”, URL = “/en”, weight = 100 }
]

[languages.en.Menus]
main = [
{ Name = “Posts”, URL = “/en”, weight = 5 },
{ Name = “About me”, URL = “/en/about”, weight = 10 },
{ Name = “Portuguese Version”, URL = “/”, weight = 100 }
]

At least in my case, I didn’t have to add relURL or relLangURL anywhere using my theme (soho)