ข้ามการนำทาง
13

WPML and NextGen Gallery

Introduction

NextGen Gallery is one of the most popular gallery plugins for WordPress. It provides many useful gallery management features. Its integration with WPML enables easy translation of textual content generated by the plugin. We would have not reached this level of compatibility without a successful working relationship with the imagely team.

 What you will need

  • NextGen Gallery plugin (version 2.1.31 or above)
  • A recent version of WPML (version 3.3.7 or above) and the String Translation add-on.

 Essential resources

 Getting started

  • Install and activate the WPML plugin along with the String Translation add-on.
  • Install and activate the NextGen Gallery plugin

 Create your gallery and add it to the gallery page

  1. On your WordPress dashboard navigate to “Pages” > “Add New”.
  2. Fill in the title for your gallery page and click on the NextGen gallery icon to add a gallery to the page.

Gallery page

  1. Navigate to the “Add Gallery / Images” tab, fill in your gallery name and click on the “Add Files” button and select the images that you want to upload. Then, click on the “Start Upload” button.

Create your gallery

  1. Navigate to the “Display Galleries” tab, choose the gallery that you created to be displayed, and click on the “Save” button.

Add the gallery to page

  1. Click on the “Publish” button to publish your gallery page.

 Translate your gallery’s textual content

NextGen Gallery integration with WPML allows you to translate:

  • The gallery title and description
  • The images titles and description

This can be achieved by following the below steps:

  1. On your WordPress dashboard navigate to “WPML” > “Theme and plugins localization”
  2. Choose the “NextGEN Gallery by Photocrati” checkbox and click on the “Scan selected plugins for strings” button.

Scan the selected plugins for strings

  1. Navigate to “WPML” > “String Translation” and choose “plugin_ngg” text domain from the drop down menu.

Note that “plugin nextgen-gallery” test domain contains  strings in NextGen Gallery’s PHP code and not the textual content of your galleries.

  1. Click on the “translations” link next to the string that you want to translate, add your translated text, choose “Translation is complete” and then click on the “Save” button.

Translate the gallery strings

  1. Now all we have to do is to translate our gallery page by navigating to “Pages” and clicking on the icon next to the gallery page.

Trnslate the gallery page

  1. Click on the “Override with English content” button, then “Translate independently” .
 Overwrite with English content  Translate independently
  1. Now you can add the translation to the page title and body. Note that the “Slideshow link text” can be translated by clicking on the gallery to open up the gallery options. On the “Display Galleries” tab click on “ Customize the display setting” and add your translated text to the “Slideshow link text” field and click on the save button. Click on the “Update” button.

Translate the gallery page

Translate Slideshow link text

 Conclusion

The image and gallery texts display according to the language of the page they have been inserted to. You can insert the same gallery to pages in different languages and you will see different texts. The images remain the same.