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:
Émile Ré
2026-04-22 19:05:41 +04:00
parent 4678c58ab0
commit d189913ba3
5 changed files with 370 additions and 4 deletions

View File

@@ -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 {