• Resolved m4j4

    (@m4j4)


    Hi,
    I have a custom field (created with ACF – Advanced Custom Filed plugin).
    In my theme I call it like that:

    <p><?php the_field ( 'description' ); ?></p>

    How can I translate this custom field with qTranslate X?

    I’ve tried everything …

    In the template file I’ve tried:
    <p><?php __(the_field ( 'description' )); ?></p>
    <p><?php _e(the_field ( 'description' )); ?></p>
    <p><?php the_field __(( 'description' )); ?></p>
    <p><?php the_field _e(( 'description' )); ?></p>

    IN the input field I’ve tried:
    <!–:en–>English Text<–:–><!–:de–>Deutsch Text<–:–>
    [:en]English Text[:de]Deutsch

    … but nothing works. So what should I do to make this custom field translatable with qTranslate X?

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 15 replies - 16 through 30 (of 34 total)
  • It′s the second colomn where I have the pictures of the people.

    Webiste: https://www.houseofrecruitment.dk/en/

    It says: REGISTRER DIT CV – JOBS – OUTPLACEMENT – DISC TEST

    Plugin Author Gunu

    (@grafcom)

    you mean for example, the title OUTPLACEMENT?

    You tried [:dk]your translation[:en]OUTPLACEMENT ?

    It′s actually more text below that which is all in Danish. It should be possible to change into other languages when pressing a language flag.

    Does it make sense?

    Plugin Author Gunu

    (@grafcom)

    Does it make sense?

    not really ??

    What are these?

    Pieces of a page or post or exceprts?

    Do you use widgets for the home page?

    It is text that I inserted into Theme Options –> Homepage Settings –> Homepage Headline Options

    How do I make a test copy?

    Plugin Author Gunu

    (@grafcom)

    Sorry, I′m simply not good enough to do that. I have to find someone else that knows about Theme Options, if you don′t know what it is… Thank you again.

    B R Michael

    Plugin Author Gunu

    (@grafcom)

    or create, temporary, a new admin so I can watch.

    That would be the easiest way to do it. However, I wouldn′t be comfortable giving others access to our website. Sorry! B R Michael

    Plugin Author Gunu

    (@grafcom)

    @nicoline2009,

    ok, I understand, success!

    Hi, first of all thanks for this great plugin. I need to hide custom fields which does not have content in the current language but have on other language, but instead I get “(other language) text in other language”

    Hope I can make myself clear:

    I’m using ACF4 latest version, acf-qtranslate 1.7.6 and your plugin, latest version.

    I set two languages, english and spanish, and created two qtranslate WYSIWYG fields for “pages” post types: text_1 and text_2.

    I’ve created a new test page, where text_1 have only content in english (“English text), while text_2 have only content in spanish (“Texto en espa?ol”).

    When I called them on the frontend

    the_field( 'text_1' );
    echo "<br>";
    the_field( 'text_2');

    I get on the english version of the site the following result:
    English text
    (Espa?ol) Texto en espa?ol

    How can I get rid of this “(Other language) Text in other language” and only display fields which are completed in the current language?

    Do I make myself clear? Is there anyway to hide this, as we do with the_content()?

    Thank you very much in advance.

    Hello Clause and Gunu:

    I was using theme adventurous and wanted to get one custom field translated.

    I changed original adventurous-promotion-headlines.php
    from:

    $adventurous_homepage_headline .= '<h2>' . $homepage_headline . '</h2>';
    to:

    $adventurous_homepage_headline .= '<h2>' . sprintf( __('%s', 'adventurous' ), $homepage_headline ) . '</h2>';

    And used [:en]English[:zh]中文 in the field. Seems no use.

    Can you help here?

    Hmm, looks like something is changed WP – all my translated images descriptions are ignored – all languages appear in one row without quotes.

    <!–:en–>English Text<!–:–><!–:de–>Deutsch Text<!–:–>

    OK, looks like [:en]sample text[:de]sample text

    works. just a couple hundreds of images’ descriptions to change ??

    EDIT: pfew, automatic conversion script worked like a charm!

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘How to translate a custom field with qTranslate X?’ is closed to new replies.