Role translation

I want to add role translations according to the logged in user language, but this does not seem to be working as it always defaults to English.

If I have something like…

# users/admin.yml

title: Admin
description:
  en: Description example
  pt_PT: Descrição exemplo

…the en translation always shows by default even if I’m logged in with the pt_PT language.

I tried using the panel.language option, including injecting it through the ready option but same the behavior remains.

This seems to be specific with roles. If I do the same with a field label (for example) it works as expected.

Is this a bug?

Thank you.

Works for me using a Kirby 4.3.0 Starterkit.

Now this is weird.

It seems that having the following line of code interferes with it:

# config.php

return [
  'ready' => function(Kirby $kirby) {
    $user = $kirby->user();
    $isAdmin = $user?->isAdmin() ?? false; // this line
  
    // ...
  }
]

Can you try it? I’m using version 4.3.0 as well.

Yes, I can reproduce this.