FAQ Schema and WPML translation
-
1. First I fill in the questions and answers in the English version of the page and then turn on “Enable Schema Support” in the settings:
https://image.prntscr.com/image/wFT9N4qrQdOdzXmKoZSInQ.jpgSo the code is:
<!-- wp:uagb/faq {"block_id":"84b9b4a0-ed17-4334-9088-cd3212d22bea","enableSchemaSupport":true,"schema":"{\u0022@context\u0022:\u0022https://schema.org\u0022,\u0022@type\u0022:\u0022FAQPage\u0022,\u0022mainEntity\u0022:[{\u0022@type\u0022:\u0022Question\u0022,\u0022name\u0022:\u0022First question?\u0022,\u0022acceptedAnswer\u0022:{\u0022@type\u0022:\u0022Answer\u0022,\u0022text\u0022:\u0022First answer.\u0022}},{\u0022@type\u0022:\u0022Question\u0022,\u0022name\u0022:\u0022Second question?\u0022,\u0022acceptedAnswer\u0022:{\u0022@type\u0022:\u0022Answer\u0022,\u0022text\u0022:\u0022Second answer.\u0022}}]}"} --> <div class="wp-block-uagb-faq uagb-faq__outer-wrap uagb-block-84b9b4a0-ed17-4334-9088-cd3212d22bea uagb-faq-icon-row uagb-faq-layout-accordion uagb-faq-expand-first-false uagb-faq-inactive-other-true uagb-faq-equal-height" data-faqtoggle="true"><script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"First question?","acceptedAnswer":{"@type":"Answer","text":"First answer."}},{"@type":"Question","name":"Second question?","acceptedAnswer":{"@type":"Answer","text":"Second answer."}}]}</script><div class="uagb-faq__wrap uagb-buttons-layout-wrap"><!-- wp:uagb/faq-child {"block_id":"f5c65f56-abc7-4712-8bf0-6dc7f6547c28","question":"First question?","answer":"First answer."} --> <div class="wp-block-uagb-faq-child uagb-faq-child__outer-wrap uagb-block-f5c65f56-abc7-4712-8bf0-6dc7f6547c28"><div class="uagb-faq-child__wrapper"><div class="uagb-faq-item"><div class="uagb-faq-questions-button uagb-faq-questions"><span class="uagb-icon uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-icon-active uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-question">First question?</span></div><div class="uagb-faq-content"><span><p>First answer.</p></span></div></div></div></div> <!-- /wp:uagb/faq-child --> <!-- wp:uagb/faq-child {"block_id":"770fa734-7a1a-4341-856b-cc6aa453d366","question":"Second question?","answer":"Second answer."} --> <div class="wp-block-uagb-faq-child uagb-faq-child__outer-wrap uagb-block-770fa734-7a1a-4341-856b-cc6aa453d366"><div class="uagb-faq-child__wrapper"><div class="uagb-faq-item"><div class="uagb-faq-questions-button uagb-faq-questions"><span class="uagb-icon uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-icon-active uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-question">Second question?</span></div><div class="uagb-faq-content"><span><p>Second answer.</p></span></div></div></div></div> <!-- /wp:uagb/faq-child --></div></div> <!-- /wp:uagb/faq -->
2. Then I create a new page in WPML with translation into Polish (for example) using its Classic editor:
https://image.prntscr.com/image/uIlTot1VRQ_ja7lFkh1THA.jpg3. Now I have 3 textareas to translate (uagb/faq, uagb/faq-child and another uagb/faq-child). I only change the text of the questions there.
And here is the output on the translated page:
<div class="wp-block-uagb-faq uagb-faq__outer-wrap uagb-block-84b9b4a0-ed17-4334-9088-cd3212d22bea uagb-faq-icon-row uagb-faq-layout-accordion uagb-faq-expand-first-false uagb-faq-inactive-other-true uagb-faq-equal-height" data-faqtoggle="true"><script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"First question?","acceptedAnswer":{"@type":"Answer","text":"First answer."}},{"@type":"Question","name":"Second question?","acceptedAnswer":{"@type":"Answer","text":"Second answer."}}]}</script><div class="uagb-faq__wrap uagb-buttons-layout-wrap"><div class="wp-block-uagb-faq-child uagb-faq-child__outer-wrap uagb-block-f5c65f56-abc7-4712-8bf0-6dc7f6547c28"><div class="uagb-faq-child__wrapper"><div class="uagb-faq-item"><div class="uagb-faq-questions-button uagb-faq-questions"><span class="uagb-icon uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-icon-active uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-question">Pierwsze pytanie?</span></div><div class="uagb-faq-content"><span><p>Pierwsza odpowied?.</p></span></div></div></div></div> <div class="wp-block-uagb-faq-child uagb-faq-child__outer-wrap uagb-block-770fa734-7a1a-4341-856b-cc6aa453d366"><div class="uagb-faq-child__wrapper"><div class="uagb-faq-item"><div class="uagb-faq-questions-button uagb-faq-questions"><span class="uagb-icon uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-icon-active uagb-faq-icon-wrap"><svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 448 512"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg></span><span class="uagb-question">Drugie Pytanie?</span></div><div class="uagb-faq-content"><span><p>Druga odpowied?.</p></span></div></div></div></div> </div></div>
So you can see that for the visible part of the page this is completely translated, however, the Scheme for Google’s search results remains in English.
Perhaps this is due to block_id conflict? Anyway, is there any way to fix this?
- The topic ‘FAQ Schema and WPML translation’ is closed to new replies.