Multilingual Support for Partials?


I am facing an issue when trying to use my multilingual site with different partials. Let me explain:

my config.toml:

DefaultContentLanguage = "en"
    title = "My Site"
    languageName = "English"
    contentDir = "content/english"
    weight = 1
    title = "My French Title"
    languageName = "French"
    contentDir = "content/french"
    weight = 2

My http://localhost:1313 and http://localhost:1313/fr work pretty fine: No issues

Issue is with my baseof.html file

<!DOCTYPE html>
<html lang="{{ with .Site.Languages }}{{ . }}{{ else }}en-US{{ end }}">
    {{- partial "head.html" . -}}
        {{- partial "header.html" . -}}
        {{- block "main" . }}{{- end }}
        {{- partial "footer.html" . -}}

Both index.html and are working fine and I am able to separately customize both. However, my footer is still stuck with the original en one even when I switch to fr.

I understand that this is due to that fact that the footer is a partial, but trying in the same folder as footer.html is not solving as well.

Please help me with the code to change it so that I can utilize en footer for English and fr footer for French


I created another and changed the reference to footer partial. Works now :slight_smile:

1 Like

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