Bỏ qua điều hướng

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.

Để lại phản hồi

Vui lòng bám sát chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi yêu cầu hỗ trợ.

Bạn có thể sử dụng các thẻ sau:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>