To explain why you see some images take the original domain and some are not, it is because the domain is save when the image is uploaded. So if you uploaded an image in the original domain, it will show everywhere with the original domain.
There is a temporary workaround:
- Enable/Install WPML Media plugin.
- Go to wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-image-translate.php
- Add the code below:
do_action( 'wpml_switch_language', $language );
- Rigth after:
public function get_translated_image( $attachment_id, $language, $size = null ) {
$image_url = '';
$attachment = new WPML_Post_Element( $attachment_id, $this->sitepress );
$attachment_translation = $attachment->get_translation( $language );
if ( $attachment_translation ) {
- So the result should be:
public function get_translated_image( $attachment_id, $language, $size = null ) {
$image_url = '';
$attachment = new WPML_Post_Element( $attachment_id, $this->sitepress );
$attachment_translation = $attachment->get_translation( $language );
if ( $attachment_translation ) {
do_action( 'wpml_switch_language', $language );
- Then try to edit the article that has the image (In its original language) by adding a character in the title, for example.
- Save the changes
- Update translations
- Go to WPML > Media Translation and save one of the images.
1. "So if you uploaded an image in the original domain, it will show everywhere with the original domain." ==> sorry but it is not the case, just make the test and you'll notice it. It just bugs on some images on this site. I have other sites under WPML and it works perfectly fine.
2. I tried to installed WPML Media. So I added the plug-in OGTS installer on my site. But when I activate it, it does not work. I can not active it. There is a bug.
Is it possible to activate OGTS Installer when others WPML Media plug-in are activated ? FYI:other plug-in are disabled, excepted woo-commerce and WPML...
Thank you for your answer. As we did have a scenario like yours it worths to try and see ethe solution given there works for you or not.
YOu do not need to install the OTGS intaller.
Please keep WPML Multilingual CMS plugin enabled and follow the steps below:
- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- In the list select the WPM Media Translation plugin.
- At the bottom of the table select the "Activate" checkbox and click download.
- That should install the plugin and after that do the changes mentioned int he steps before.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.