WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Custom Fields
[resolved] qTranslate and NextGEN Custom Fields (9 posts)

  1. alexcosta
    Member
    Posted 1 year ago #

    Hi.
    I added a text area custom field to ngg and used the qTranslate tags in the text:

    <!--:en-->English Text<!--:-->
    <!--:pt-->Portuguese Text<!--:-->

    But when i echo the value of the text area it echoes the 2 laguages:

    English Text Portuguese Text

    NextGEN Custom Fields doesn't work with qTranslate or am i doing something wrong?

    Thanks

    http://wordpress.org/extend/plugins/nextgen-gallery-custom-fields/

  2. alexcosta
    Member
    Posted 1 year ago #

    Also using the short tags [:en] and [:pt] doesn't work.

  3. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hi alex
    I'm not familiar with qTranslate. I will try find some time to run it on a test installation and see if I can understand the problem.

  4. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    I'm getting a fatal error trying to install qTranslate to a clean SVN version of WordPress.
    I will try again later, but there's not much I can do if the plugin won't even install :)

  5. alexcosta
    Member
    Posted 1 year ago #

    Hi Shauno, thanks for the reply.

    I forgot to tell that the qTranslate plugin that is in wordpress.org only works with WordPress 3.4.1.
    To work with the 3.4.2 version one must download the qTranslate development version from the author site in .

    Thanks

  6. alexcosta
    Member
    Posted 1 year ago #

    Sorry the link didn´t show up.

    It's http://www.qianqin.de/qtranslate/download/

  7. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    I got it installed, but I'm not sure how it is supposed to work. I don't have the time to go through all the help docs, so can you give me an overview of how you are using NGG Custom fields, and qTranslate together, and what you are expecting to happen?

  8. alexcosta
    Member
    Posted 1 year ago #

    Hi Shauno. I think i got it.

    Normally to make a multilingual site with qTranslate one must wrap the content we write in special tags eg:

    <!--:en-->English text<!--:-->
    <!--:pt-->Texto Portugues<!--:-->

    Then the plugin only shows the content language based on the browser language.

    This works great with almost all plugins i have except NextGen Gallery, and now with NextGEN custom fields.
    I think the problem is with NextGEN because from what i have read it doesn´t play well with qTranslate.

    After a lot of reading i figured out:

    Instead of:
    <?php echo nggcf_get_gallery_field($gallery->ID, "Custom Field Name"); ?>

    one must change it to:

    <?php echo __(html_entity_decode(nggcf_get_gallery_field($gallery->ID, "Custom Field Name"), ENT_NOQUOTES)); ?>

    I´m not a PHP pro so i don´t fully understand this code but it works.

    Thanks

  9. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Alex
    What that code you pasted does is wrap the custom field value in WordPress' translation function, which it seems is needed by qTranslate.
    I'm glad you found a solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic