You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when a website has a multi-language setup, the plugin finds the locale based on the active language code, but I believe it should get the language locale instead, to be coherent with how Kirby handles translations too.
For example, I am from Portugal, and the code we use is pt (for the URL) but out locale is pt_PT (Portuguese from Portugal, different from pt_BR (Brazil), pt_AO (Angola), and so on).
So right now, if I have the Portuguese language with code pt and locale pt_PT, the popup will be in German, instead of the pt_PT translation that currently exists in the plugin, because it is trying to find the pt.php translation file instead of the pt_PT.php.
This can be solved by changing the following line code:
privatestaticfunctiongetTranslations()
{
$translations = kirby()->option('zephir.cookieconsent.translations');
$locale = kirby()->option('zephir.cookieconsent.language.locale', 'en');
if (option('languages')) {
// change this line// $locale = kirby()->language()->code();$locale = kirby()->language->locale(LC_ALL);
}
if (empty($translations[$locale])) {
return$translations[array_key_first($translations)];
}
return$translations[$locale];
}
I can create a PR if you want.
Thank you.
The text was updated successfully, but these errors were encountered:
My response times are a bit long as we have moved from Kirby to Statamic, which suits our needs better.
I will still maintain the plugin by merging PRs and releasing them, but it will take some time for me to respond.
Currently, when a website has a multi-language setup, the plugin finds the locale based on the active language code, but I believe it should get the language locale instead, to be coherent with how Kirby handles translations too.
For example, I am from Portugal, and the code we use is
pt
(for the URL) but out locale ispt_PT
(Portuguese from Portugal, different frompt_BR
(Brazil),pt_AO
(Angola), and so on).So right now, if I have the Portuguese language with code
pt
and localept_PT
, the popup will be in German, instead of thept_PT
translation that currently exists in the plugin, because it is trying to find thept.php
translation file instead of thept_PT.php
.This can be solved by changing the following line code:
I can create a PR if you want.
Thank you.
The text was updated successfully, but these errors were encountered: