Wrong language for objects in site.txt

We recently switched from Kirby 2 to the latest version. Great job to the whole Kirby team!

However I ran into a strange issue. The contents from the site.de.txt are not displayed correctly, but only if a page from from the first directory level.

To make this more clear:

The site.de.txt and site.en.txt are the same, except the translations. The default language is English.

Some of you have any idea? Thanks in advance!

So the footer calls content from the site.xx.txt file?

Yes.

There are definitions like:

  • Ctatext
  • Ctabuttons
  • Disclaimer
  • etc…

How do you fetch the content? Could you please post the footer code?

Sure, here are two examples:

<?php echo $site->ctatext()->kirbytext() ?>

or the other way around:

<?php echo kirbytext($site->copyright()) ?>

Hm, ok, that is nothing special and should work as expected, although I would change the second line from

<?php echo kirbytext($site->copyright()) ?>

to

<?php echo $site->copyright()->kirbytext() ?>

Do these two pages you mention above both have content files in both languages?

I can just guess here without actually having a look at what is happening.

Since the site content works in one page but not in another, it doesn’t look as if anything was broken regarding readability etc.

Sorry, I wasn’t precise. I just took two different examples, but they produce the same issue. They are basically reading different text parts from the source file site.[lang].txt

In the meantime I am not that sure anymore if the issue really come from the site.txt. The reason is the different behaviour when calling the pages from our website:

So it is basically only the first folder level with produces the Wong language in the footer. Fun fact: all other contents are in the correct language.

I am lost…

The question is if all these different pages really use the same code in the footer/the same footer. All I can offer is to have a look at your project, this is probably one of those things that are obvious if you see what is happening but hard to debug from remote.

Yes, all pages does use the same source.
And yes, I’d love to get personal support.

Your project is probably to big to just send it around as a zip file I assume? Maybe you can provide access to your staging server?

I’ve send you an e-Mail.

Solution: The culprit was a route in a plugin.

1 Like

Kudos! Very well done!