hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
979 stars 567 forks source link

Site always shows English language independent of browser settings/weights #932

Closed tht closed 2 months ago

tht commented 2 months ago

Expected Behavior

When configuring mutliple languages with weights I expect to see the the language with the lowest weight when opening the webpage for the first time.

Configuration is as follows:

languageCode: de

# Manage languages
# For any more details, you can check the official documentation: https://gohugo.io/content-management/multilingual/
languages:
  de:
    languageName: Deutsch
    weight: 1
  en:
    languageName: English
    weight: 3

# Force a locale to be use, really useful to develop the application ! Should be commented in production, the "weight" should rocks.
#DefaultContentLanguage: de

I've also tested languageCode: de-ch. Same effect.

The only way to make sure the page opens in German is to use DefaultContentLanguage which triggers the issue #916.

Current Behavior

When visiting the site I always see the english language. Also english is deployed to the site root, additional languages are deployed to a sub-directory.

Possible Solution

Steps to Reproduce

(See configuration snippet above)

Screenshots

(none)

Browsers Affected

Detailed Description

English seems to be hardcoded as default language on the root dir. Maybe slightly related to #916.

hossainemruz commented 2 months ago

The issue should be fixed now. Please, try pulling the latest change. Specify defaultContentLanguage to your default language.

tht commented 2 months ago

Works for me, thanks a lot for looking into it and also for this lovely theme.