yii2-usuario
yii2-usuario copied to clipboard
i18n and gdprPrivacyPolicyUrl and gdprConsentMessage
How can these settings reflect the current user language?
It would be nice if this could be part of the application configuration.
``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;