Go to main content

help desk

How can I update all the CT of my site when I activate a new language?

I just activated the English language on my site and I would like to know how to update all English fields of the CTs with the French version.

Asked on 0000-00-00 00:00:00

OFFICIAL ANSWER

You can run an SQL update to transfer the french text in the englsih field if there was no value.
 

Several entries without english content

-- sed_core_ct_global TEXT
UPDATE sed_core_ct_global
SET
 text_en = text_fr
WHERE 1
 AND FIND_IN_SET(format, 'text')
 AND text_fr IS NOT NULL
 AND LENGTH(text_fr) > 0
 AND (LENGTH(text_en) = 0 OR text_en IS NULL);


-- sed_core_ct_global CK
UPDATE sed_core_ct_global
SET
 ck_en = ck_fr
WHERE 1
 AND FIND_IN_SET(format, 'ck')
 AND ck_fr IS NOT NULL
 AND LENGTH(ck_fr) > 0
 AND (LENGTH(ck_en) = 0 OR ck_en IS NULL);


-- sed_site_ct_global (Text only)
UPDATE sed_site_ct_global
SET
 text_en = text_fr
WHERE 1
 AND FIND_IN_SET(format, 'text')
 AND text_fr IS NOT NULL
 AND LENGTH(text_fr) > 0
 AND (LENGTH(text_en) = 0 OR text_en IS NULL);


-- sed_site_ct_local (Text only)
UPDATE sed_site_ct_local
SET
 text_en = text_fr
WHERE 1
 AND FIND_IN_SET(format, 'text')
 AND text_fr IS NOT NULL
 AND LENGTH(text_fr) > 0
 AND (LENGTH(text_en) = 0 OR text_en IS NULL);
Answer by:
Etienne Carrier

Replied on: 2022-02-10 09:35:00