Newly added language does not load plugin translations

Hello all,

I have a really strange behavior of my current kirby setup. I have a properly working multilanguage setup. The languages en and de are showing in the frontend as expected. The translations from the content, the language translations and plugin translations do what they should.

We need to add a new language es to the page. So we added a new language-file es.php to the kirby languages folder. Properly working :white_check_mark: We started to translate the content. Also properly working :white_check_mark: We started to add es.php files to the languages folder of some plugins. The translations are not picked up by kirby and we only see the default language :no_entry_sign:

Strange is, that the β€œold” languages from the plugins still work. Does anyone have an idea how to further investigate or better to solve this issue?

This part I don’t quite understand. Are these files then included in the index.php of those plugins? Are these plugins you own plugins or third party plugins?

Yes, we include these language files in the index.php of the plugin as follows:

Kirby::plugin('sample/plugin', [
    'blueprints' => [
...
    ],
    'snippets' => [
...
    ],
    'translations' => [
        'en' => require_once __DIR__ . '/languages/en.php',
        'de' => require_once __DIR__ . '/languages/de.php',
        'es' => require_once __DIR__ . '/languages/es.php'
    ]
]);

The plugins are our owns.

I think you need to rename the key to es_ES

Screenshot 2023-05-12 at 15.56.18