# Kirby 5 Beta 2: site() causes panel translation issues in plugins

**URL:** <https://forum.getkirby.com/t/kirby-5-beta-2-site-causes-panel-translation-issues-in-plugins/33441>\
**Category:** Questions\
**Tags:** v5\
**Created:** [January 27, 2025, 7:21am UTC](https://forum.getkirby.com/t/kirby-5-beta-2-site-causes-panel-translation-issues-in-plugins/33441 "2025-01-27T07:21:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grommasdietz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/grommasdietz/32/14539_2.png) [@grommasdietz](https://forum.getkirby.com/u/grommasdietz)\
**Post date:** [January 27, 2025, 7:21am UTC](https://forum.getkirby.com/t/kirby-5-beta-2-site-causes-panel-translation-issues-in-plugins/33441/1 "2025-01-27T07:21:53Z")

</div>

Hi everyone

While testing Kirby 5 (currently beta 2), I encountered an issue where the panel’s site translation for all secondary languages stops working when using `site()` . This happened, for example, in a panel plugin where I conditionally load blueprints based on user roles:

```php
$blueprintSite = __DIR__. '/blueprints/editor.yml';

if (site()->userIs('admin')) {
    $blueprintSite = __DIR__. '/blueprints/admin.yml';
}

use Kirby\Cms\App;

App::plugin('grommasdietz/gd-site-blueprint', [
    'blueprints' => [
        'site' => $blueprintSite,
    ],
]);

```

I fixed this by switching to `kirby()` instead of `site()` :

```php
if ($user = kirby()->user()) {
    if ($user->role() == 'admin') {
        $blueprintSite = __DIR__. '/blueprints/admin.yml';
    }
}

```

I noticed the same problem e.g. on this plugin for a virtual home page:

```php
use Kirby\Cms\App;
use Kirby\Cms\Page;
use Kirby\Uuid\Uuid;

load([
    'HomePage' => 'models/HomePage.php',
], __DIR__ );

App::plugin('grommasdietz/gd-virtual-homepage', [
	'pageModels' => [
		'home' => HomePage::class
	],
	'pages' => [
		'home' => new Page([
			'slug' => 'home',
			'template' => 'home',
			'content' => [
				'title' => site()->title(), // conflicting, works without
				'uuid' => Uuid::generate(),
			]
		])
	],
]);

```

The issue seems to be related to the use of `site()` in a multi-language setup:

- Instead of rendering translated fields for secondary languages, the content always falls back to the default language.
- Removing `site()` resolves the conflict, but it’s not ideal.

I’ve briefly checked the changelog but couldn’t find any reason for this behavior. Could this be a regression? If so, I’m happy to create a GitHub bug report.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [January 27, 2025, 9:26am UTC](https://forum.getkirby.com/t/kirby-5-beta-2-site-causes-panel-translation-issues-in-plugins/33441/2 "2025-01-27T09:26:35Z")

</div>

It’s a known problem : [Incorrect site content in multi-language setup after a plugin uses site()-\>content() · Issue #2629 · getkirby/kirby · GitHub](https://github.com/getkirby/kirby/issues/2629)

Sadly for a long time (so also before v5) but just super hard to solve.

---

<div class="post-metadata">

**Author:** ![grommasdietz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/grommasdietz/32/14539_2.png) [@grommasdietz](https://forum.getkirby.com/u/grommasdietz)\
**Post date:** [January 27, 2025, 9:40am UTC](https://forum.getkirby.com/t/kirby-5-beta-2-site-causes-panel-translation-issues-in-plugins/33441/3 "2025-01-27T09:40:56Z")

</div>

Ah, I see! Recently reworked my boilerplate based on v5 and came across this. As far as I can tell, these two specific scenarios worked fine in v4, so perhaps some of the refactorings in v5 are intensifying the issue?

Thanks for checking into this and providing the reference! Since my custom site blueprint is already functional, I’ll adjust the logic for the virtual homepage to conditionally construct the title. That should resolve it for my case.
