Default language suddenly not working?

Im confused. Ive picked up an old project. a hugoplate themed template.
I want dutch as default language. ill add english later.

defaultContentLanguageInSubdir = true
defaultContentLanguage = ‘nl’

In root hugo.toml, doesnt work. It will always use en. I cant disable english either, since it’s default.
The docs state clearly, that it should be in the root config file. And it is?
This is my languages.toml
[nl]

contentDir = ‘content/dutch’

disabled = false

languageCode = ‘nl-NL’

languageDirection = ‘ltr’

languageName = ‘NL’

Please share the entire hugo.toml file.

######################## default configuration ####################
# The base URL of your site (required). This will be prepended to all relative URLs.
baseURL = "/"
# Title of your website (required).
title = "Jana Schatto"

# Your theme name
theme = "hugoplate"
# Default time zone for time stamps; use any valid tz database name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
timeZone = "Europe/Amsterdam"
timeout = "80s"
# post pagination
[pagination]
  pagerSize = 2 # see https://gohugo.io/extras/pagination/
# post excerpt
summaryLength = 10 # see https://gohugo.io/content-management/excerpts/
# disable language
disableLanguages = [ 
    ["en"]
] # example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/
hasCJKLanguage = false #  If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
# default language
defaultContentLanguage = 'nl'
# defaultContentLanguageInSubdir need to be true if you want to use the language code as a subdirectory and language specific 404 page
defaultContentLanguageInSubdir = true

########################### Services #############################
[services]
[services.googleAnalytics]
ID = 'G-MEASUREMENT_ID' # see https://gohugo.io/templates/internal/#configure-google-analytics

[services.disqus]
shortname = 'themefisher-template' # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/

########################## Permalinks ############################
[permalinks.page]
"pages" = "/:slugorfilename/"


############################# Modules ############################
[module]
[[module.mounts]]
source = "assets"
target = "assets"

[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"

############################# Build ##############################
[build]
noJSConfigInAssets = false
useResourceCacheWhen = 'fallback'
[build.buildStats]
enable = true
[[build.cachebusters]]
source = 'assets/watching/hugo_stats\.json'
target = 'style\.css'
[[build.cachebusters]]
source = '(postcss|tailwind)\.config\.js'
target = 'css'
[[build.cachebusters]]
source = 'assets/.*\.(js|ts|jsx|tsx)'
target = 'js'
[[build.cachebusters]]
source = 'assets/.*\.(css|scss|sass)'
target = 'css'
[[build.cachebusters]]
source = 'data/.*\.(.*)$'
target = 'css'
[[build.cachebusters]]
source = 'assets/.*\.(.*)$'
target = '$1'


############################# Outputs ############################
[outputs]
home = ["HTML", "RSS", "WebAppManifest", "SearchIndex"]

############################# Imaging ############################
[imaging]
# See https://github.com/disintegration/imaging
# Default JPEG or WebP quality setting. Default is 75.
quality = 80
resampleFilter = "Lanczos"

############################ Caches ##############################
[caches]
[caches.images]
dir = ":resourceDir/_gen"
maxAge = "720h"

[caches.assets]
dir = ":resourceDir/_gen"
maxAge = "720h"


############################ Markup ##############################
[markup]
[markup.goldmark.renderer]
unsafe = true

[markup.highlight]
style = 'monokai' # see https://xyproto.github.io/splash/docs/all.html

[markup.tableOfContents]
startLevel = 2
endLevel = 5
ordered = true


########################### Media types ###########################
[mediaTypes]
[mediaTypes."application/manifest+json"]
suffixes = ["webmanifest"]


########################### Output Format ##########################
[outputFormats]
[outputFormats.WebAppManifest]
mediaType = "application/manifest+json"
rel = "manifest"

[outputFormats.SearchIndex]
mediaType = "application/json"
baseName = "searchindex"
isPlainText = true
notAlternative = true


############################# Plugins ##############################

# CSS Plugins
[[params.plugins.css]]
link = "plugins/swiper/swiper-bundle.css"
lazy = true
[[params.plugins.css]]
link = "plugins/glightbox/glightbox.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/brands.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/solid.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/icons.css"
lazy = true

# JS Plugins
[[params.plugins.js]]
link = "js/search.js"
lazy = false
[[params.plugins.js]]
link = "plugins/swiper/swiper-bundle.js"
lazy = false
[[params.plugins.js]]
link = "plugins/cookie.js"
lazy = false
[[params.plugins.js]]
link = "plugins/glightbox/glightbox.js"
lazy = true
[[params.plugins.js]]
link = "js/gallery-slider.js"
lazy = true
[[params.plugins.js]]
link = "js/accordion.js"
lazy = true
[[params.plugins.js]]
link = "js/tab.js"
lazy = true
[[params.plugins.js]]
link = "js/modal.js"
lazy = true
[[params.plugins.js]]
link = "plugins/youtube-lite.js"
lazy = true

Seen two problems with your config

  1. top level keys below a table definition won’t work. (see TOML Table

    move your pagination settings behind the last top level key (after line 25)

  2. your disableLanguages is an array of arrays, should be a simple string array

    correct disableLanguages to be a plain array: disableLanguages = ["en"]

toml adjusted
######################## default configuration ####################
# The base URL of your site (required). This will be prepended to all relative URLs.
baseURL = "/"
# Title of your website (required).
title = "Jana Schatto"

# Your theme name
theme = "hugoplate"
# Default time zone for time stamps; use any valid tz database name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
timeZone = "Europe/Amsterdam"
timeout = "80s"
# post pagination
# post excerpt
summaryLength = 10 # see https://gohugo.io/content-management/excerpts/
# disable language
disableLanguages = ["en"]
# example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/
hasCJKLanguage = false #  If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
# default language
defaultContentLanguage = "nl"
# defaultContentLanguageInSubdir need to be true if you want to use the language code as a subdirectory and language specific 404 page
defaultContentLanguageInSubdir = true

[pagination]
  pagerSize = 2 # see https://gohugo.io/extras/pagination/

thanks. dunno why it was like that from the get go. Cant remember i’d changed anything since I left the project and never really read up on toml, using yaml mostly. Maybe some copilot change i accidently accepted.

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