Language specific content

Is it possible to select content <?= $page->content() ?> in case German is selected, but not if it is English?

Something like an IF on the language locale?

Not quite sure what you mean.

You can create a condition like

<?php
if ($kirby->language()->code() === 'de') {
  // do stuff
} else {
  // do something else
}

@texnixe Thank’s!

I’ll try it.

To give you a little explanation on what am I trying to achieve:

I have the following sentence “Lasst es uns GREEN machen”, were GREEN is “knockout text” that is integrated as a picture. Therefore I have text snippet, than image, followed by another text snippet.

In English, the sentence is “Let’s do it GREEN”. Therefore the rundown is different, with the full text, followed by the image.

The standard Kirby translation logic is replacing the text one by one. Therefor I was looking for options.

Wouldn’t it make more sense to use a string template in that case where the knockout text is then replaced by the image?

Lasst es uns {{ GREEN }} machen.
Let's make it {{ GREEN }}.

Replace the part in double curly braces with the image.

Hey Sonja, both solutions are working! But I agree, the one with the curly brackets in this case is the better one.

I just didn’t know this curly bracket option existed.