Page translation works, footer translation does not

I work with:

I have pages:

Everything works as it should, but I also need to translate the footer of the website so that the text in it is translated, I wanted to solve it using the languages.yaml file, but I also need to insert links in the footer, which I can’t do in the .yalm file.

The problem is as follows, the documentation says that I can work with a file in a template, for example: templates/
So I assumed that with the file: templates/partials/

But I can’t do that, the language isn’t translated and the template still only works with basic files:

templates / default.html.twig
templates / partials / footer.html.twig

What am I doing wrong does this someone understand where I am making a mistake?

Thank you guys!


I also need to insert links in the footer

  • How do your Twig snippet for the link look like?

which I can’t do in the .yalm file

  • What have you tried so far?

I don’t know if I understand what you’re asking?

I created a file:
Into which I changed the path to the base:

{% extends 'partials/' %}

and i created a file:
Into which I changed the path to the footer.

     {% block footer%}
         {% include 'partials /'%}
     {% endblock%}

I tried:

FOOTER: '<a href="link" target="_blank">Contact</a>'

FOOTER: "<a href='link' target='_blank'>Contact</a>"

"[I'm an inline-style link]("

@Deight, No need to use language specific templates.

  • Create file user/languages/sk.yaml and add:

    FOOTER: '<a href="link" target="_blank">Kontakt</a>'
  • Create file user/languages/en.yaml and add:

    FOOTER: '<a href="link" target="_blank">Contact</a>'
  • In template '/user/themes/your-child-theme/templates/partials/footer.html.twig` add:

    {{ 'FOOTER' | t | raw }}

Note that filter raw is required to insert html into the page.


Don’t get me wrong, but I really like you, 2 hours of rehearsals and you helped me a lot again, thank you!