Select field languages - show it in frontend

Hey,

Couldn’t find a solution for a rather easy problem i guess.

yml: 
Discipline:
  label: Discipline
  type: select
  max: 1
  options:
    "vortrag":
      en: Presentation
      de: Vortrag

php:
<?php $month = $site->find('Programm')->children() ?>
<?php foreach($month->children() as $event): ?>
  <?php foreach ($event->Discipline()->split(',') as $tag): ?>
                 <?= $tag ?>
  <?php endforeach ?>
<?php endforeach ?>

When the site switches to english, “presentation should be displayed”.
Anyone can help? Thx! <3

What’s the purpose of this loop? The select field only ever has one value, so using split() to create an array doesn’t make sense.

You can get the option label from the blueprint, for a pointer see Using blueprints in the frontend | Kirby CMS

ah, sure. it worked also so i didn’t question it.
now it is this:
<?= $event->Discipline()?>

but how do i get the language from this field anyways?
it also doesn’t show the english text in the panel which is strange because it would when i take away the ‘de’ version and the rest of the site works perfect with 2 languages.

yml: 
Discipline:
  label: Discipline
  type: select
  max: 1
  options:
    "vortrag":
      en: Presentation
      de: Vortrag

That is probably a misunderstanding of how this is supposed to work. In the Panel, the translation is part of the user interface, therefore it adapts to the chosen user language, not to the currently selected translation language.

As to how to get this label, there are multiple options. One is going the blueprint way, according to what I linked to in the cookbook recipe.

Another option would be to translate those values in your language variables.Custom language variables | Kirby CMS