WPML

Panoramica del problema

Quando usi WPML con Spectra Legacy, alcuni testi dei blocchi restano nella lingua predefinita nelle pagine tradotte: le etichette di Countdown, l’etichetta “Tweet” di Blockquote, gli elementi, il tempo e il costo di How-To, il testo alternativo di Image e l’etichetta di Icon.

Inoltre, molti blocchi tradotti risultano non validi nell’editor a blocchi (“Questo blocco contiene contenuti inaspettati o non validi”): Buttons, Call To Action, Icon List, Team, Testimonial, Blockquote, How-To, Review, Countdown, Restaurant Menu e Content Timeline. Se ripristini uno di questi blocchi, i suoi testi tornano alla lingua predefinita.

Soluzione alternativa

  • Vai a WPMLImpostazioniConfigurazione XML personalizzata, aggiungi questo codice e salva:
    <wpml-config>
      <custom-types>
        <custom-type translate="1">spectra-popup</custom-type>
      </custom-types>
      <custom-fields>
        <custom-field action="copy">spectra-popup-type</custom-field>
        <custom-field action="copy">spectra-popup-enabled</custom-field>
        <custom-field action="copy">spectra-popup-repetition</custom-field>
      </custom-fields>
      <gutenberg-blocks>
        <gutenberg-block type="uagb/buttons-child" translate="1">
          <xpath type="link">//a/@href</xpath>
          <xpath>//div[@class="uagb-button__link"]</xpath>
          <xpath>//*[@class="uagb-button__link"]</xpath>
          <xpath>//*[@class="uagb-button__wrapper"]</xpath>
          <xpath>//div//a</xpath>
          <key name="label" />
          <key name="link" type="link" />
        </gutenberg-block>
        <gutenberg-block type="uagb/team" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//span[@class="uagb-team__prefix"]</xpath>
          <xpath>//p[@class="uagb-team__desc"]</xpath>
          <key name="title" />
          <key name="prefix" />
          <key name="description_text" />
        </gutenberg-block>
        <gutenberg-block type="uagb/testimonial" translate="1">
          <xpath>//div[@class="uagb-tm__desc"]</xpath>
          <xpath>//span[@class="uagb-tm__author-name"]</xpath>
          <xpath>//span[@class="uagb-tm__company"]</xpath>
          <key name="test_block"><key name="*"><key name="description" /><key name="name" /><key name="company" /></key></key>
        </gutenberg-block>
        <gutenberg-block type="uagb/review" translate="1">
          <xpath>//*[contains(@class, "uagb-rating-title")]</xpath>
          <xpath>//p[contains(@class, "uagb-rating-desc")]</xpath>
          <xpath>//p[contains(@class, "uagb-rating-author")]</xpath>
          <xpath>//p[@class="uagb_review_summary_title"]</xpath>
          <xpath>//p[@class="uagb_review_summary_desc"]</xpath>
          <xpath>//div[@class="uagb_review_entry"]/div</xpath>
          <key name="rTitle" />
          <key name="rContent" />
          <key name="rAuthor" />
          <key name="summaryTitle" />
          <key name="summaryDescription" />
          <key name="featuresTitle" />
          <key name="featuresAvgText" />
          <key name="items"><key name="*"><key name="label" /></key></key>
        </gutenberg-block>
        <gutenberg-block type="uagb/faq-child" translate="1">
          <xpath>//*[@class="uagb-question"]</xpath>
          <xpath>//*[@class="uagb-faq-content"]/span/p</xpath>
          <key name="question" />
          <key name="answer" />
        </gutenberg-block>
        <gutenberg-block type="uagb/inline-notice" translate="1">
          <xpath>//*[@class="uagb-notice-title"]</xpath>
          <xpath>//*[@class="uagb-notice-text"]/p</xpath>
          <key name="noticeContent" />
        </gutenberg-block>
        <gutenberg-block type="uagb/restaurant-menu-child" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//div[@class="uagb-rm__desc"]</xpath>
          <xpath>//span[@class="uagb-rm__price"]</xpath>
          <key name="title" />
          <key name="description" />
          <key name="price" />
        </gutenberg-block>
        <gutenberg-block type="uagb/content-timeline-child" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//div[@class="uagb-timeline__date-new"]/div</xpath>
          <xpath>//div[@class="uagb-timeline__inner-date-new"]</xpath>
          <xpath>//p[@class="uagb-timeline-desc-content"]</xpath>
          <key name="time_heading" />
          <key name="time_desc" />
        </gutenberg-block>
        <gutenberg-block type="uagb/call-to-action" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//p[@class="uagb-cta__desc"]</xpath>
          <xpath>//*[@class="uagb-cta__buttons"]</xpath>
          <xpath>//span[@class="uagb-cta__link-content-inner"]/span</xpath>
          <xpath type="link">//a[contains(@class,"uagb-cta__block-link")]/@href</xpath>
          <xpath type="link">//*[@class="uagb-cta__buttons"]/a/@href</xpath>
          <key name="ctaText" />
          <key name="secondCtaLabel" />
          <key name="ctaLink" type="link" />
          <key name="secondCtaLink" type="link" />
        </gutenberg-block>
        <gutenberg-block type="uagb/marketing-button" translate="1">
          <key name="link" type="link" />
          <xpath type="link">//a/@href</xpath>
          <xpath>//*[@class="uagb-marketing-btn__title"]</xpath>
          <xpath>//p[@class="uagb-marketing-btn__prefix"]</xpath>
          <xpath>//div//a</xpath>
        </gutenberg-block>
        <gutenberg-block type="uagb/wp-search" translate="1">
          <xpath>//input[@class="uagb-search-form__input"]/@title</xpath>
          <xpath>//input[@class="uagb-search-form__input"]/@placeholder</xpath>
        </gutenberg-block>
        <gutenberg-block type="uagb/icon-list-child" translate="1">
          <xpath>//span[@class="uagb-icon-list__label"]</xpath>
          <xpath type="link">//div[contains(@class, "wp-block-uagb-icon-list-child")]/a/@href</xpath>
          <xpath>//div[contains(@class, "wp-block-uagb-icon-list-child")]/a/@aria-label</xpath>
          <key name="label" />
          <key name="link" type="link" />
        </gutenberg-block>
        <gutenberg-block type="uagb/blockquote" translate="1">
          <xpath>//div[@class="uagb-blockquote__content"]</xpath>
          <xpath>//cite[@class="uagb-blockquote__author"]</xpath>
          <xpath>//footer/a</xpath>
          <key name="iconView" />
          <key name="iconLabel" />
          <key name="descriptionText" />
          <key name="author" />
        </gutenberg-block>
        <gutenberg-block type="uagb/how-to" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//img/@alt</xpath>
          <xpath>//img/@title</xpath>
          <xpath>//p[@class="uagb-howto-desc-text"]</xpath>
          <xpath>//div/p/span</xpath>
          <xpath>//p[@class="uagb-howto-timeNeeded-value"]</xpath>
          <xpath>//p[@class="uagb-howto-estcost-value"]</xpath>
          <xpath>//div[contains(@class, "uagb-tools__label")]</xpath>
          <xpath>//div[contains(@class, "uagb-materials__label")]</xpath>
          <key name="headingTitle" />
          <key name="headingDesc" />
          <key name="materials"><key name="*"><key name="add_required_materials" /></key></key>
          <key name="tools"><key name="*"><key name="add_required_tools" /></key></key>
          <key name="time" />
          <key name="cost" />
          <key name="estCost" />
          <key name="timeNeeded" />
          <key name="timeIn" />
          <key name="toolsTitle" />
          <key name="materialTitle" />
          <key name="stepsTitle" />
        </gutenberg-block>
        <gutenberg-block type="uagb/countdown" translate="1">
          <xpath>//div[@class="wp-block-uagb-countdown__label"]</xpath>
          <key name="labelDays" />
          <key name="labelHours" />
          <key name="labelMinutes" />
          <key name="labelSeconds" />
        </gutenberg-block>
        <gutenberg-block type="uagb/image" translate="1">
          <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
          <xpath>//figcaption[@class="uagb-image-caption"]</xpath>
          <xpath>//figure/figcaption</xpath>
          <xpath>//img/@alt</xpath>
          <key name="alt" />
          <key name="id" type="post-ids" sub-type="attachment" />
        </gutenberg-block>
        <gutenberg-block type="uagb/icon" translate="1">
          <key type="link" name="link" />
          <key name="iconAccessabilityDesc" />
        </gutenberg-block>
        <gutenberg-block type="uagb/google-map" translate="1">
          <key name="language" />
          <key name="address" />
        </gutenberg-block>
      </gutenberg-blocks>
    </wpml-config>
  • Aggiorna la traduzione di ogni pagina che usa i blocchi Spectra.

Tutti i problemi noti

Hai bisogno di aiuto con questo problema?

Fai una richiesta di supporto e la esamineremo con te.