x_ml
1
I want to access menu params based on the current language:
In my config.json
{"params":
"menu": {
"en": {
"home": "Home",
"tour": "Tour",
"business": "Business",
"pricing": "Pricing"
},
"es": {
"home": "HOME",
"tour": "TOUR",
"business": "BUSINESS",
"pricing": "PRICING",
}
}
}
And I want to do this:
<a href="/home">{{ .Site.Params.menu.(site language code here).home }}</a>
I’ve tried using
{{ $SiteLang := .Site.Language.Lang }}
<a href="/home">{{ .Site.Params.menu.$SiteLang.home }}</a>
but it all returns errors.
x_ml
2
Does anyone know of a solution for this?
Don’t know if it would help, but here’s how my multilingual menus are set up.
And here’s how my config.yml is setup.
HTH