So, I use a plugin called Polylang to help me maintain a multilingual WordPress site. In my experience, it has a better user experience than WP-ML, though it does have some teething problems. For example, I was creating a Hebrew version of my Photo Gallery page to demonstrate the ease of language switching in relation to a previous post I wrote. However, none of the images I had uploaded were appearing in my Media Library.
The problem has a solution: you need to create a version of the page for each language you intend to use it in. This doesn’t mean you have to upload it one time for each and every language. Here’s how you do it:
Step 1: Go into the picture in question
At the bottom right-hand corner of the modal window, you should see a link that reads “Edit more details”. It is sitting in between between “Delete Permanently” and “View Attachment Page”. Click “Edit more details”.
Step 2: Find the language and click the “plus” icon next to it
In the right-hand sidebar, there should be a list of the languages you added, along with a dropdown menu to select the language this picture should be in. Click the language you want to add details for. For the purposes of this tutorial, I’ll select “Esperanto”.
Step 3: Fill in the appropriate metadata for the image and hit “Update”.
Basically, update the title of the media object in question, modify the alt-text and hit “Update”. With this, you should be done for the language you want to add.
Some final notes
You’ll have to repeat steps 2 & 3 for each additional language you want to add a media object for. Please be aware that this doesn’t mean that there are multiple copies of the file residing on the server. These are added in WordPress’ database as a custom post type so that when you use them across the site, it can take the alt text, title, etc you assigned to this image and reuse that metadata on other instances. Having localized alt text just makes it more useful is all.
Now, when you have “Show all languages” selected in the top menu bar, you’ll see multiple copies of the asset you added metadata for in other languages. Like this:
You can check if multiple copies were uploaded for the same language by going to the top menu bar to “Show all languages” to see only assets with data in one language.
In this instance, I’ll select “Esperanto”. And here are the just the images with metadata in Esperanto.
Also, add appropriate metadata to your image. You’ll thank yourself later when you don’t have to hunt down an image you previously uploaded.
It’s worth noting that you can choose in the Polylang settings not to link media posts to a language. However, I think given the necessity of having alt text for the sake of accessibility, it’s still a good practice.