Add i18n data structures for cookie banner
Add cookie_banner_translations table to store per-language translations as JSONB, and a default_language column on cookie_banners. Extend the version snapshot types to carry translated UI strings and category content per language. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -30,10 +30,22 @@ import (
|
||||
|
||||
type (
|
||||
CookieBannerVersionSnapshot struct {
|
||||
PrivacyPolicyURL string `json:"privacy_policy_url"`
|
||||
ConsentExpiryDays int `json:"consent_expiry_days"`
|
||||
ConsentMode string `json:"consent_mode"`
|
||||
Categories []CookieBannerVersionSnapshotCategory `json:"categories"`
|
||||
PrivacyPolicyURL string `json:"privacy_policy_url"`
|
||||
ConsentExpiryDays int `json:"consent_expiry_days"`
|
||||
ConsentMode string `json:"consent_mode"`
|
||||
DefaultLanguage string `json:"default_language"`
|
||||
Categories []CookieBannerVersionSnapshotCategory `json:"categories"`
|
||||
Translations map[string]CookieBannerVersionSnapshotTranslation `json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
CookieBannerVersionSnapshotTranslation struct {
|
||||
UI map[string]string `json:"ui"`
|
||||
Categories []CookieBannerVersionSnapshotCategoryTranslation `json:"categories"`
|
||||
}
|
||||
|
||||
CookieBannerVersionSnapshotCategoryTranslation struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
CookieBannerVersionSnapshotCategory struct {
|
||||
|
||||
Reference in New Issue
Block a user