Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by priitP-4 5 months, 3 weeks ago.

Assigned support staff: Laura.

Author Posts
May 28, 2019 at 7:35 am #3903533

priitP-4

Hey WPML team!

Want to change/translate image url when language are changed. I can change string but cant do changes in link In Estonian language (a ref="hidden link") and must changed in Russian language (a ref="hidden link else").

Are there some snippets or filters to do that?

All Best

May 28, 2019 at 3:40 pm #3908489

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

thanks for contacting us.

I'm not sure what you are trying to do. Media links point to the URL of the image, so if you don't translate the image (= you are not using a different image) the link will be the same in all languages.

Can you give me a real example of what are you trying to do, with a link to your site possibly?

May 29, 2019 at 6:27 am #3912077

priitP-4

Hey!

Just I need to linking my image correct language page when changing site language. Main language is ok, but need to change that image link in my second language. Its custom Woocommerce plugin image.

I think I need some snippets to change this image link when choose second language

May 29, 2019 at 9:31 am #3913911

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

I don't understand what you mean with "I need to linking my image correct language page". If you don't use a different image the link doesn't need to be changed.

If you need to use a different image, you can use WPML Media Translation.
Otherwise, you can load different images for each language library.

May 29, 2019 at 9:52 am #3914067

priitP-4

Hey!

Attention! No problem with image url, but image LINK url: a ref="https:some link.
If you understand what a tag is in html?

May 29, 2019 at 10:29 am #3914207

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

yes, I understand what "a" tag is in HTML. I'm sorry but your previous messages weren't clear at all.

Internal links should be automatically translated by WPML. Where are inserted these links?

May 29, 2019 at 10:44 am #3914297

priitP-4

Hey, Laura!

Its a custom woocommerce credit plugin image with a link. I only access that image link in main language, but need to replace that image link when second lanuage choosed. Just need some code snippet/filter to replace that image link when language has changed.

May 29, 2019 at 3:13 pm #3916791

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

it might be enough to wrap the link in a GetText call https://wpml.org/faq/language-setup/

or you can check our hooks:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/
https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

wpml_get_translated_slug could be what you are looking for

May 30, 2019 at 6:22 am #3920675

priitP-4

Need to do modification in custom module. Added variable localization.
My issue is resolved now. Thank you!