WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
Can we add multilingual support via WPML? (8 posts)

  1. AmirHelzer
    Member
    Posted 3 years ago #

    I'm responsible for WPML and I'd like to make WPML and NextGen work together fully for multilingual sites.

    NextGen includes the i18n function for translating strings. We can easily filter your localization filter and allow users to translate everything, but I feel that this solution would be most challenging for users.

    What will happen is that site admins will need to sort through hundreds of tiny unrelated strings in order to find what to translate, as the current i18n function doesn't include any context.

    What I'm suggesting is to include two additional optional arguments to the function, so that it will look like:
    function i18n($in, $context, $name)

    Then, when i18n is used in your code, we'll add the context and name of each translatable string.

    For example, the context can be the ID of an image and the name would be the field. You'll have things like:

    $picture->alttext = html_entity_decode( stripslashes(nggGallery::i18n($picture->alttext), 'picture'.$picture->id,'alttext') );
    $picture->linktitle = htmlspecialchars( stripslashes(nggGallery::i18n($picture->description,'picture'.$picture->id,'description')) );

    This way, admins will see translatable strings grouped together and with their full context.

    We'll be more than happy to do this work on NextGen code, test and return it to you for review. We'll update the i18n function and everywhere it's used in your code. It's going to take just a few hours to code and test.

    NextGen will remain 100% compatible with other translation plugins that your i18n function currently supports and offer easier translation management.

    Would you be interested in this?

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

  2. Trouffman
    Member
    Posted 3 years ago #

    I do !!

    Great work on WPML lately Amir ;)

  3. tradiart
    Member
    Posted 3 years ago #

    Great news! We have a customer site with WPML and NextGen, although we haven't started to translate. If you need testing, we can help.

    Thank you Amir, making a website multilingual has never been so easy :-)

  4. AmirHelzer
    Member
    Posted 3 years ago #

    Yup, now just waiting for an OK from NextGen author. As soon as we get it, we'll write the code.

  5. Alex Rabe
    Member
    Posted 3 years ago #

    I will test it, at the best post your changes here : http://code.google.com/p/nextgen-gallery/issues/detail?id=274

  6. lindebjerg
    Member
    Posted 3 years ago #

    This would be so great, the best Gallery plugin working with best multilingual plugin:-) cannot wait to see the first version on WordPress.

  7. AmirHelzer
    Member
    Posted 3 years ago #

    Hi Alex,

    Good to hear from you. We'll get it done next week.

  8. AmirHelzer
    Member
    Posted 3 years ago #

    We're done with the changes in NGG and I wrote about it in this blog post.

    This is the updated NGG code:
    http://wpml.org/wp-content/uploads/2011/03/nextgen-gallery.zip

    The changes are pretty simple. We updated the i18n code so that it also accepts a 2nd, optional, $name argument:

    function i18n($in, $name = null)

    This name tells WPML what the string is for. Then, when users go to translate, they know what they're translating (like 'alt' tag, 'description', 'title', etc.).

    The change doesn't influence anything else. Other multilingual plugins still use the i18n function just like before. The extra $name argument is only for WPML's use.

    If you want to test it with WPML, you'll need the current development version. Leave a comment in our post and I'll email it to you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic