Relative links and multi language

I try to move my multi language homepage from kirby1 to kirby2. Almost everything works fine. The selected language remains while using the menu for navigating.
Unfortunately, the kirbytext - relative links do not work anymore as supposed. Here the url() is build always without $language->code(), so that I always get redirected to the right content but the default language.

Imagine the following structure:

content/home/home.de.txt, home.fr.txt, home.it.txt, home.en.txt
content/contactform/contactform.de.txt, contactform.fr.txt, contactform.it.txt, contactform.en.txt

I placed a relative link to the contact form on all four home’s, like this:
(link: contactform/contactform)

With Kirby1:
calling this link from home.de, it got translated to: server/de/contactform/contactform
calling this link from home.en, it got translated to: server/contactform/contactform (because english is defined as default)

With Kirby2:
calling this link from home.de, it gets translated to: server/contactform/contactform
calling this link from home.fr, it gets translated to: server/contactform/contactform
calling this link from home.en, it gets translated to: server/contactform/contactform

Probably, I did a mistake, but I do not see it. Could anybody give me a hint?

Thank you !

I quickly tested this on one my of my multi-lang installations just to find that I encountered the same problem, the link generated by the kirbytag is the same for both languages, looks like you have to put the language code in front for the relative link to work

Hi, I have the same problem. :cold_sweat: @bastianallgeier: is it a bug or a feature? For me it looks like a bug.

I have the same problem. My site has a german and english version (Kirby 2). German is set as the default language. My multi language menu is working fine but if I use relativ URLs, for example <?php echo url('contact')?> I always get the german default version, even if I was previously in the English version. :confused:

Any ideas how to solve this?

Its no fix for kirbytext links but in the template you can use

<?php echo $pages->find('contact')->url() ?>

instead and it should work. It’s working in my Kirby2 Installation.

Yep! That works for me. Thank you! :smiley:

I came to the same problem. Would be great to hear what’s @bastianallgeier’s opinion about if this is a bug or a feature …

I’m not really into git and those things … but maybe somebody else could create a bugreport there? (You do such things on github, right?)

Yes, GitHub is the place for such things. I opened an issue

Creating an issue on Github is no big deal, really