Remove unused available_languages from cookie banner config

The field was populated by the backend and declared in the TS interface
but never consumed by any client-side code. The banner resolves its
language via detectLanguage() and passes it as a query param.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-23 11:19:33 +04:00
parent 1361dda425
commit f9458fb18a
2 changed files with 0 additions and 14 deletions

View File

@@ -27,9 +27,6 @@ import { detectLanguage } from "./i18n";
import { enqueue, flush } from "./queue";
import { getOrCreateVisitorId } from "./visitor";
export type { BannerTexts } from "./i18n";
export { interpolate } from "./i18n";
export interface CookieItem {
name: string;
duration: string;
@@ -48,7 +45,6 @@ export interface BannerConfig {
version: number;
language: string;
default_language: string;
available_languages: string[];
privacy_policy_url: string;
consent_expiry_days: number;
consent_mode: "OPT_IN" | "OPT_OUT";

View File

@@ -130,7 +130,6 @@ type (
Version int `json:"version"`
Language string `json:"language"`
DefaultLanguage string `json:"default_language"`
AvailableLanguages []string `json:"available_languages"`
PrivacyPolicyURL string `json:"privacy_policy_url"`
ConsentExpiryDays int `json:"consent_expiry_days"`
ConsentMode string `json:"consent_mode"`
@@ -1707,14 +1706,6 @@ func buildBannerConfig(
defaultLang = "en"
}
availableLanguages := make([]string, 0, len(snapshot.Translations))
for l := range snapshot.Translations {
availableLanguages = append(availableLanguages, l)
}
if len(availableLanguages) == 0 {
availableLanguages = []string{defaultLang}
}
resolvedLang := defaultLang
if lang != "" {
if _, ok := snapshot.Translations[lang]; ok {
@@ -1748,7 +1739,6 @@ func buildBannerConfig(
Version: version.Version,
Language: resolvedLang,
DefaultLanguage: defaultLang,
AvailableLanguages: availableLanguages,
PrivacyPolicyURL: snapshot.PrivacyPolicyURL,
ConsentExpiryDays: snapshot.ConsentExpiryDays,
ConsentMode: snapshot.ConsentMode,