Support

Account

Home Forums Front-end Issues Display the label with WPML in other languages

Unread

Display the label with WPML in other languages

  • Hello, dear ACF Team!

    Firstly I want to thank you for the wonderful plugin))

    I have a small problem with the translation of labels. I have content on 4 languages in the site (WPML plugin)

    Steps that I did:
    – Created custom fields group & added custom fields
    – Created custom fields in other languages too with the same slugs. For example, dosageform in English & dosageform in Russian (but with the different Labels)
    – Added them to the template (single-drug.php) – Custom post type.
    – Create accordion with jquery and added ACF fields to the template single-drug.php like this:

    <?php if ($dosageform = get_field('dosageform')) { ?>
    <div class="faq">
      <div class="faq_question">
         <span class="question"><?php _e('Лекарственная форма', 'jarida') ?></span>
         <span class="accordion-button-icon fa fa-angle-double-down"></span>
    </div>
    <div class="faq_answer_container">
        <div class="faq_answer">
          <span><?php echo $dosageform  ?></span>
        </div>
      </div>
    </div>
    <?php } ?>

    Question: How I should translate or edit the code above so that it works and that when the language is switched the label also changes. ?

    I read several topics from the forum, and also set up the WPML plugin according to the instructions:


    https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

    Thanks in advance!

Viewing 1 post (of 1 total)

The topic ‘Display the label with WPML in other languages’ is closed to new replies.