Adding class to language option button

I’m building a site that uses two languages with selection buttons in the footer. I want to add a class to the

  • when that language is active I have tried adding the below to the
  • but I think I must be doing something wrong.

        <ul class="nav-language">
          <li <?= $page->isOpen() ? 'class="active"' : 'class=" "' ?> ><a href="<?= $page->url('en') ?>" aria-label="change to English language" class="md">EN</a></li>
          <li <?= $page->isOpen() ? 'class="active"' : 'class=" "' ?> ><a href="<?= $page->url('ga') ?>" aria-label="change to Irish language" class="md">GA</a></li>
  • See example here how to do this programmatically instead of manually:Switching languages in the frontend | Kirby CMS

    Yup, thanks.