Ignore untranslated legacy widget copy

This commit is contained in:
rajchales-monito
2026-07-30 08:17:29 +02:00
parent 7a7ab5dfca
commit d49c672feb
+3 -1
View File
@@ -1117,7 +1117,7 @@ function normalizeWidgetCopy(value, settings = {}) {
for (const language of legacyLanguages) { for (const language of legacyLanguages) {
const lang = allowedWidgetLanguage(language); const lang = allowedWidgetLanguage(language);
if (!lang) continue; if (!lang) continue;
copy[lang] = { const legacyCopy = {
...(copy[lang] || {}), ...(copy[lang] || {}),
title: settings.title?.[lang], title: settings.title?.[lang],
intro: settings.intro?.[lang], intro: settings.intro?.[lang],
@@ -1125,6 +1125,8 @@ function normalizeWidgetCopy(value, settings = {}) {
placeholder: settings.placeholder?.[lang], placeholder: settings.placeholder?.[lang],
sendLabel: settings.sendLabel?.[lang] sendLabel: settings.sendLabel?.[lang]
}; };
if (lang !== "cs" && lang !== "en" && widgetCopyLooksUntranslated(defaultWidgetCopy("cs"), normalizeWidgetCopyEntry(legacyCopy, lang))) continue;
copy[lang] = legacyCopy;
} }
copy.cs = normalizeWidgetCopyEntry(copy.cs || defaultWidgetCopy("cs"), "cs"); copy.cs = normalizeWidgetCopyEntry(copy.cs || defaultWidgetCopy("cs"), "cs");
copy.en = normalizeWidgetCopyEntry(copy.en || defaultWidgetCopy("en"), "en"); copy.en = normalizeWidgetCopyEntry(copy.en || defaultWidgetCopy("en"), "en");