Made in Europe, buy from Europe.

Black Friday

65% off Annual plans

25% off Lifetime · 10 per week

Ends December 2

Get the deal →

How to use Modula with Polylang

Updated 5 min read

You can show Modula galleries on a multilingual site made with Polylang, a plugin that translates your pages. Modula has no special Polylang integration, and Polylang doesn’t translate Modula galleries. Galleries aren’t public pages, so they don’t appear in Polylang’s list of post types.

To show galleries on a multilingual site, you add a gallery to each translation of your page.

Watch how to set up Polylang, add the gallery to each translation of a page, and make a gallery copy with translated image texts.

You can do this in two ways. Pick the one that fits your images.

  • The same gallery on every translation: This works when your images show no text, or when their texts can stay in one language.
  • One gallery per language: You need this when image titles, captions or alt text must be in the visitor’s language. See Translate image titles, captions and alt text.

Before you start

First set up Polylang and translate your page. If your site already has this, go to the next section.

  1. To install Polylang, go to Plugins → Add Plugin.
  2. Search for Polylang.
  3. Click Install Now.
  4. Click Activate.
  5. To add your languages, go to Languages → Languages.
  6. Pick a language in Choose a language.
  7. Click Add new language.

    Polylang's Add new language form with Choose a language and the Add new language button
  8. Translate the page that will show the gallery. In the page editor, the Languages box shows the page’s Language.

    Under Translations, you see a + for each other language. Click it to create the translation. Once the translation exists, you see a pencil icon instead.

    This Polylang tutorial shows the whole setup.

    The Languages box in the page editor: the page is in English and its Spanish translation has a pencil icon

Now add the gallery to the page in your main language, and then to its translation.

  1. Edit the page in your main language.
  2. Click the + (block inserter) and add the Modula Gallery block.
  3. Click Display An Existing Gallery.
  4. Type in Search for a gallery… and pick the gallery.

    The Modula Gallery block with Search for a gallery… and the list of galleries
  5. Save the page.
  6. In the Languages box, click the pencil icon next to the other language. The translation opens.
  7. Add the Modula Gallery block there too.
  8. Pick the same gallery, or the gallery you made for that language.
  9. Save the translation.

Instead of the block, you can paste the gallery’s shortcode, like [modula id="89"], into a Shortcode block, a Classic block or a page builder. A shortcode is a short piece of text in square brackets that shows the gallery.

Copy the shortcode from the Shortcode column in Modula → Galleries. More ways are in Insert galleries in posts and pages.

With the Albums extension (Modula Pro), albums work the same way. Make one album per language from that language’s galleries. Then add it with the Modula Albums block or its [modula-album id="…"] shortcode.

Translate image titles, captions and alt text

Alt text is the short description of an image for people who can’t see it. An image’s title, caption and alt text are saved on the image in the Media Library, not in the gallery.

Every gallery that uses that image shows the same texts. When you change them in one gallery, they change in all of them.

So a gallery in another language needs its own copies of the images. Polylang can make these copies for you without copying the files.

Make a translated copy of the gallery

  1. Turn on media translation. Go to Languages → Settings and click Activate on the Media module.
  2. Go to Media → Library and switch to the list view.
  3. Click the + under the other language’s flag, next to an image. Polylang creates the copy and opens it.
  4. Type the title, Caption and Alternative Text in that language.
  5. Click Update. Do steps 3 to 5 for each image in the gallery.
  6. Go to Modula → Galleries.
  7. Hover the gallery and click Duplicate. You get a “Copy of …” gallery with the same images and settings, and its own shortcode.

    A gallery and its copy made with Duplicate in the Content list, each with its own shortcode
  8. Open the copy and click the pencil next to its name to rename it, for example “Urban & Architecture (ES)”.
  9. Click the first image, then click Edit image on it.
  10. Click Replace and pick that image’s copy in the other language. The image keeps its place in the gallery. Alt text, Title and Caption now show the translated texts.

    An image in the gallery copy with its Alt text, Title and Caption in Spanish
  11. Use the arrows next to Image 1 of … to go to the next image. Replace it in the same way.
  12. If the gallery uses filters, rename them in the copy’s Filters section.
  13. Add the copy to the translated page, as in Add a gallery to each translation.

Tip: Polylang’s language filter in the admin bar also filters the media library. Pick the other language there before you click Replace. The media window then shows only that language’s copies.

Note: Don’t type the new language into an image before you replace it. Until then, the copy still uses the original image. You would change the texts in the first gallery too.

You may not use Polylang’s media translation. In that case, upload the image again in the Replace window instead. The new upload is a separate image in the Media Library, and you can type its texts in the copy.

Example

Here is how the result looks on a real site. The English page shows one gallery:

The English page with its gallery

When the visitor switches to Spanish, the translated page shows the gallery made for it:

The Spanish translation of the page with its own gallery
Was this page helpful?
0 0

Still stuck?

Can’t find the answer?

Write to us with what you tried and what you expected to happen, and we’ll help you sort it out.