Clarify widget save translation action
This commit is contained in:
@@ -375,6 +375,25 @@ function defaultWidgetCopy(language) {
|
||||
};
|
||||
}
|
||||
|
||||
function legacyCzechWidgetCopy() {
|
||||
return {
|
||||
title: "Potrebujete poradit?",
|
||||
intro: "Napiste nam. Odpovime co nejdrive.",
|
||||
offlineIntro: "Ted nejsme online, ale zpravu nam muzete nechat.",
|
||||
placeholder: "Napiste zpravu...",
|
||||
sendLabel: "Odeslat",
|
||||
dropzoneLabel: "Pridat fotku nebo pretahnout",
|
||||
onlineLabel: "Jsme online",
|
||||
offlineLabel: "Offline",
|
||||
newReplyLabel: "Nova odpoved",
|
||||
typingLabel: "Operator pise...",
|
||||
infoTitle: "GDPR informace",
|
||||
infoText: "Zpravu a technicke udaje relace zpracujeme jen pro odpoved na vas dotaz.",
|
||||
closeLabel: "Zmensit chat",
|
||||
operatorReplyLabel: "odpovida"
|
||||
};
|
||||
}
|
||||
|
||||
function configuredUsers() {
|
||||
const users = [];
|
||||
for (let i = 1; i < 50; i += 1) {
|
||||
@@ -1139,9 +1158,11 @@ function normalizeWidgetCopy(value, settings = {}) {
|
||||
|
||||
function normalizeWidgetCopyEntry(value, language) {
|
||||
const defaults = defaultWidgetCopy(language === "en" ? "en" : "cs");
|
||||
const legacyCs = language === "cs" ? legacyCzechWidgetCopy() : null;
|
||||
const copy = {};
|
||||
for (const field of WIDGET_COPY_FIELDS) {
|
||||
copy[field] = String(value?.[field] || defaults[field] || "").trim();
|
||||
if (legacyCs && copy[field] === legacyCs[field]) copy[field] = defaults[field];
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user