okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 134 forks source link

Multi-lingual site shows both languages at the same time in nav and footer #792

Closed schoettl closed 4 years ago

schoettl commented 4 years ago

BUG REPORT

What happened:

In the default language, the menu (and footer as well) shows both translations:

test

What you expected to happen:

Only items of one language should be visible.

How to reproduce it (as minimally and precisely as possible):

See https://github.com/schoettl/syna-start/commit/e13e458586ed5efed2d15bb1507f71e061ab27b6 (one commit based on syna-starter)

Environment:

mpourismaiel commented 4 years ago

@stp-ip What do you think? Should we remove current language button or implement it in some other way?

schoettl commented 4 years ago

Oh, I hope it is not a misunderstanding:

I'm fine with the two language selector buttons "en" and "de".

The problem is that both translations "Home" and "Zuhause" are visible. In the default language "en", there should only be "Home", "About Us", "Contact".

mpourismaiel commented 4 years ago

Oh I didn't see that. Thanks for reporting it. I'll get right on it.

mpourismaiel commented 4 years ago

Not sure why this happens. Also I'm not sure about the syntax you're using. Seems like the method described in the Menus section of Multilingual Mode documentation uses a different syntax that works with Syna. To clarify, I mean using this syntax:

[languages.en]
  weight = 0
  languageName = "English"

[[languages.en.menu.main]]
  url    = "/"
  name   = "Home"
  weight = 0

[languages.de]
  weight = 10
  languageName = "Deutsch"

[[languages.de.menu.main]]
  url    = "/"
  name   = "Startseite"
  weight = 0
schoettl commented 4 years ago

Oh than it's probably my fault – I'll check it out. I'm not used to this toml configuration...

schoettl commented 4 years ago

Alright, it was a TOML misconfiguration on my side.

TOML doesn't care of indentation; the property name in brackets must always be a fully-qualified property name.

(I don't like the syntax, that's why I suggested to switch to YAML in syna configuration and front matter...)

Thank you for your help!