Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Footer Menu translations

theme

Started by Max 4 years ago · 2 replies · 550 views
4 years ago

Hey,

thanks to the easy language system I get a multi-lang site pretty quickly done. There is, however, a question on how to translate the footer links?

In a previous question it was discussed on how to create a footer menu dynamically via taxonomy tag (footer menu dynamically). But it was also mentioned that hard-coded links might serve the purpose in case they don't change frequently.

But if I hard-code any links, how can I adjust the link text based on the language selected by the langswitcher plugin?

Any ideas how to set up such a language sensitive footer menu?

4 years ago

Hi, @MJR ono way could be to use translation via twig:
<a href="#">{{ "THEME_NAME.FOOTER_LINK"|t|e }}</a>
and put in the languages.yaml file of your inherited theme + add the translation you need

YAML
en:
  THEME_NAME:
    FOOTER_LINK: Footer link text
4 years ago

Hi @b.da thanks for this suggestion, I will try to do it this way and report back, if this is useful for me.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 317 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago