yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

i18n and gdprPrivacyPolicyUrl and gdprConsentMessage

Open robsch opened this issue 2 years ago • 1 comments

How can these settings reflect the current user language?

It would be nice if this could be part of the application configuration.

robsch avatar Dec 23 '22 08:12 robsch

``The default gdprConsentMessage is part of module's i18n and is delivered in the user language. If you apply a custom message, you would want to apply it not in config (no app yet at that point), but apply it in any bootstrap component, eg AppBootstrap or whatever you have. In the Bootstrap you would get the module and apply the properties via your app i18n. In Bootstrap something like:

        /** @var Module $module */
        $module = Yii::$app->getModule('user');
        $module->gdprConsentMessage = Yii::t('app', "My custom message that I have in my apps i18n");
        $module->gdprPrivacyPolicyUrl = "https://example.com/".Yii::$app->language;

TonisOrmisson avatar Dec 23 '22 11:12 TonisOrmisson