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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Footer Menu translations

theme

Started by Max 3 years ago · 2 replies · 402 views
3 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?

3 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
3 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago