Do you have trouble duplicating images and other media between languages? You’re not alone. It’s always been a problem and now it’s solved.
Many themes, especially those designed for photographers and artists, rely heavily on the WordPress Gallery functionality. Until now, you had to upload copies of the same image to all translations, in order for it to appear.
The new WPML Media Translation plugin solves this in a slick way. Without wasting space on the server and without limiting your flexibility, you can now have the same images for all languages, or specific images for each translation.
Background – How WordPress Attachments Work
When you upload a file (image, video, podcast, etc.), WordPress saves it in the uploads directory. It also adds a record to the database that says File X belongs to Post Y. This record is called an attachment.
When you insert the Gallery short tag to a post, WordPress looks for all the attachments that belong to that post and displays them nicely together.
For galleries to display the same images on translated posts, the images on the disk don’t require duplication. We only need to duplicate the attachment records. This is exactly what WPML Media Translation does.
Duplicating Images for Existing Posts
After you enable WPML Media Translation, you’ll see a message offering you to complete the setup. Visit the setup page to automatically copy attachments from posts in the original language to translations.
Note: it’s not a fully symmetrical process. WPML will only copy attachments from the default language to the other languages.
And that’s all. WPML will run through all your site’s content and duplicate all attachments to the translations. Remember that since we’re only duplicating database entries, this doesn’t increase your site’s disk space.
Duplicating Images for New Posts
The post editor will include a new checkbox that says Duplicate uploaded media to translations. When checked, WPML will automatically copy the attachments you add to the default language, to all translations.
The order of operations doesn’t really matter. When there are new attachments, they’re copied. Also, when you create new translations, they get all the attachments from the default language.
There’s a similar checkbox next to the Featured Image, to duplicate it too onto translations.
Choosing Media per Language
This new attachments-duplication makes WordPress media language-aware. You can have the same physical image file associated with posts in different languages.
When you click on the Insert Image button, in the post editor, WordPress will show you images in the post’s language. You’ll find a new language selector to choose images that belong to posts in other languages too.
And, last but not least, when you visit the Media menu, you’ll also see the uploaded media per language.
To switch languages, use the Admin Bar language switcher, available in WPML 2.3.0 and above (for now, you can use the Beta version).
This plugin adds language switching to all the WordPress media management. It makes attachments language-aware and allows to easily synchronize images between translations.
All you need to do to make this happen is enable the Duplicate uploaded media to translations checkbox in the post editor. The rest happens by itself.
To download, login to your WPML.org account. This new plugin is available for both the Multilingual Blog and Multilingual CMS packages.
If an image is listed with wrong language, how do I change this?
WPML is a very good plugin!
The Media Translation plugin will make your images available as ‘media’ in all languages. Then, you don’t need to worry about what language you uploaded it to.
Hi, I’m quite pleased with the WPML over all.
But I do not manage to have the featured image at the home page showing on other languages than the original. I am using the Widgets EZ home.
The setup is: Static startpage > widgets: EZ home > Genesis – Featured page > Show featured image
http://www.hairclub.es – in original language (german) it shows the pictures in second language (english) it does not. Spanish will be next.
I have installed the »WPML Widgets« as well as »WPML Media«.
What do I do wrong?