Skip Navigation

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.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>