דלג לתוכן דלג לסרגל צד

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.

השאר תגובה

אנא הישאר בנושא והיה מכבד כלפי אחרים. אם אתה זקוק לעזרה בנושאים שאינם קשורים לפוסט זה, השתמש בפורום התמיכה שלנו כדי להתחיל צ'אט או לשלוח כרטיס.

אתה יכול להשתמש בתגים אלה:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>