Fix PR review comments on cookie banner i18n
Address locale normalization for region-tagged values, guard language detection for non-DOM runtimes, validate DefaultLanguage on update, pass translated texts through the deactivation flow, handle slug collisions in migration, add organizations FK, fix consent migration from name-keyed to slug-keyed data, render all template placeholders in previews, and wrap helper text for i18n. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -16,6 +16,8 @@ package cookiebanner
|
||||
|
||||
import "go.probo.inc/probo/pkg/coredata"
|
||||
|
||||
var SupportedLanguages = []string{"en", "fr", "de", "es"}
|
||||
|
||||
var defaultCategories = []struct {
|
||||
Name string
|
||||
Slug string
|
||||
|
||||
@@ -177,6 +177,7 @@ func (r *UpdateCookieBannerRequest) Validate() error {
|
||||
v.Check(r.PrivacyPolicyURL, "privacy_policy_url", validator.URL())
|
||||
v.Check(r.ConsentExpiryDays, "consent_expiry_days", validator.Min(1))
|
||||
v.Check(r.ConsentMode, "consent_mode", validator.OneOfSlice(coredata.CookieConsentModes()))
|
||||
v.Check(r.DefaultLanguage, "default_language", validator.OneOfSlice(SupportedLanguages))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user