Gantry 5 Helium, Multi-Language URL

Hello,
does anyone here know how I can build a multilingual website with Gantry 5 and the Helium template so that the URL is displayed in the respective language?
In Grav I get the 2nd language done with the “SLUG” but then Gantry can’t map the template because of the changed URL.

Does anyone know a solution?

Thank you for your help!

Greetings
Stefan

Hi @Kaepsele

After you have configured your languages in admin, you have to save the pages in that languages. Each page must be saved with the menu, title and content translated.

In Gantry, you have to duplicate an outline, for example, home outline. Each outline can be assigned to a specific language in Assignments tab.

You can do that with the page particle, for example, to show a page in different languages.

1 Like

Thank you for your help!
The page works in the 2 languages German and English, but I have to leave the URL in the main language German, because the Gantry menu references it.
If I enter a “Slug” in the 2nd language English so that the URL is in English, then Gantry will no longer find a reference to the template.
I hope I could explain it halfway understandable?


Hi @Kaepsele
I guess you will have two pages in the folder 02.uebermich, one with .en.md extension and another (the one in German) with .md only.

folder_pages

I don’t use the slug option for this. You have to translate only, title, menu option and content.

page_english

page_spanish

In Gantry you have to duplicate de page you want to translate. For example, in my case, the homepage in Spanish is “Inicio” and in English is “home”.

folder

In user\data\gantry5\themes\helium\config\home\assignments.yaml I have:

page:
  -
    home: true
language:
  -
    en: true
type: {  }

In user\data\gantry5\themes\helium\config\inicio\assignments.yaml I have:

page:
  -
    home: true
language:
  -
    es: true
type: {  }

That’s all. This should work Gantry in two languages.

1 Like

Thank you for your explanation and assistance!

Can you please make me a screenshot of your URL in English and Spanish?

Hi @Kaepsele

Take a look at this page. I have made a Spanish-English translation of the home page.

1 Like

Thank you for your demo page.
Can you please make a 2nd menu item, e.g. “About myself” or “Contact”, or…?

Take a look again to page.

However, you should take a look at Grav’s language help, and multilanguage.

Also, you can take a look to Gantry multilingual configuration.

1 Like

Please look to my Demo-Page: http://test.kkk-kappler.de/de
My Problem is the URL in the english-Version. Please look here: http://test.kkk-kappler.de/en/uebermich
I can’t get the URL in the English version to be English.

Have you tried to set the slug option in English page with “about_me” (without white spaces).

Take a look again to demostration page.

1 Like

Yes, exactly, thank you! Great!
Now I just have to figure out what I’m doing wrong…

Sorry, I had not yet replied to your guess whether I had written “about_myself” without hyphen.
No, with underscore, that was not the problem, but I could now finally solve the problem, thanks to your great help. :slight_smile:

The solution was that in the " In user\data\gantry5\themes\helium\config\inicio\assignments.yaml in the English version was “uebermich”, instead of “about_myself”.

about

After I adjusted this, and set the SLUG back to “about_myself”, it worked. :slight_smile:

It’s amazing, no sooner do you get it right, it works.

Thanks for your effort and especially for your patience with you. If I had read your hints more attentively, I should have figured it out earlier.

Thank you! Thank you!

Hello @Kaepsele.
I am very happy to have helped you and that together we will make this forum a source of knowledge about Grav and everything that surrounds it (Gantry, Twig, Markdown, PHP, etc)