Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v5] Plugin translation not applied in backend #6810

Open
distantnative opened this issue Nov 23, 2024 · 3 comments
Open

[v5] Plugin translation not applied in backend #6810

distantnative opened this issue Nov 23, 2024 · 3 comments
Labels
type: regression 🚨 Is a regression between versions
Milestone

Comments

@distantnative
Copy link
Member

distantnative commented Nov 23, 2024

I encountered a weird regression in Retour:

Translation that I apply in the backend (via I18n::translate) are not translated correctly anymore;

v4:
Screenshot 2024-11-23 at 09 42 13
Screenshot 2024-11-23 at 09 42 18

v5:
Screenshot 2024-11-23 at 09 42 46
Screenshot 2024-11-23 at 09 42 50

Interestingly, translation that are resolved in the frontend ({{ $t() }}) seem to work/unaffected.

@distantnative distantnative added the type: regression 🚨 Is a regression between versions label Nov 23, 2024
@distantnative distantnative added this to the 5.0.0-beta.1 milestone Nov 23, 2024
@bnomei
Copy link

bnomei commented Dec 1, 2024

I encountered a similar issue when running commands. the license label build failed when retrieving license.status.active.label because the translation array for en local is still empty.

As far as I can tell from debugging the call stack the needed AppTranslations trait defining the i18n via closure has not been called yet when kirby encounters the Kirby::plugin() from within the plugins index.php file.

$this->i18n();

@distantnative
Copy link
Member Author

@bnomei how do you use it in your plugin?

@bnomei
Copy link

bnomei commented Dec 1, 2024

in calling a command from the cli is how i encountered the issue. you should be able to replicate it.

https://github.com/bnomei/kirby3-storybook/blob/main/commands/watch.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression 🚨 Is a regression between versions
Projects
None yet
Development

No branches or pull requests

2 participants