Navigation überspringen

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using The Events Calendar PRO with WPML, and configuring Additional Fields (via Events → Settings → Additional Fields), the field values are translatable. However, the field labels do not display translated on the front end.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

Register labels for translation

  • Add the following XML configuration, in „WPML > Settings > Custom XML Configuration“:
    <wpml-config>
      <admin-texts>
        <key name="tribe_events_calendar_options">
          <key name="custom-fields">
            <key name="*">
              <key name="label" />
            </key>
          </key>
        </key>
      </admin-texts>
    </wpml-config>
            

Modify the PHP template to display the translated label

  • Open the …/wp-content/plugins/events-calendar-pro/src/views/pro/modules/meta/additional-fields.php file.
  • Look for line 22.
  • Replace:
    <dt> <?php echo esc_html( $name );  ?> </dt>
            
  • With:
    <dt> <?php esc_html_e( $name , 'admin_texts_tribe_events_calendar_options' );  ?> </dt>
            

Translate labels in String Translation

After completing the above steps, go to „WPML > String Translation“. Locate the additional field labels under the admin_texts_tribe_events_calendar_options domain and provide the necessary translations for each label.

Hinterlassen Sie eine Antwort

Bitte bleiben Sie beim Thema und respektieren Sie andere. Wenn Sie Hilfe zu Themen benötigen, die nicht mit diesem Beitrag zusammenhängen, nutzen Sie unser Support-Forum, um einen Chat zu starten oder ein Ticket zu erstellen.

Sie können diese Tags verwenden:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>