Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 22 replies, has 3 voices.

Last updated by Long Nguyen 1 year, 3 months ago.

Assisted by: Long Nguyen.

Author Posts
January 29, 2024 at 5:26 pm #15240091

anneR-12

Tell us what you are trying to do? Trying to translate the featured image and in-post images. Asked to do in in two places. How can I do this more efficiently?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

January 30, 2024 at 9:15 am #15242166

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting the support forum.
Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

The one that is coming from Kadence/image is not needed. This is a custom block from the plugin I guess so WPML is not aware of the content type and what needs to be translated.

We can define custom XML configuration for the blocks. See this article https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

Then we can exclude the images.

Another option is ATE. If you use ATE to translate the pages, ATE can filter the strings from HTML and use translation memory so you have to translate one string only one time no matter how many times that string is repeated on the website.

I would recommend to use ATE https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/

Thanks

January 30, 2024 at 1:08 pm #15243899

anneR-12

Hi Sumit,

Thanks for getting back to me.

You say that the translation coming from Kadence/image is not needed, however when I translate the images both the media section and the Kadence image block (I am required to translate both before I can publish the translation), it is the translation from the Kadence image block that is shown on the front end. The translation I set in the media section is only used for the featured image.

I do not want to use the advanced translation editor. I don't want auto generated translations and when I tried it, I seemed to be obliged to have a translation for every sentence in the original language (which doest work for me when something can be better written in only one sentence in the second language).

So that would leave me with your first suggestion. I went through the documentation, but it is not clear to me what code I should use to ''exclude images'' so that I only be prompted to translate them in the media section. What code would it be?

Should I just replace the 1 by a 0 as such:

Example of settings for translation of Gutenberg block
1
2
3
4
5
6
7
8
<wpml-config>
<gutenberg-blocks>
<gutenberg-block type="core/image" translate="0">
<xpath>//figure/figcaption</xpath>
<xpath>//figure/img/@alt</xpath>
</gutenberg-block>
</gutenberg-blocks>
</wpml-config>

Will that still allow me to translate in the images from the media section?

Thank you,
Anne

January 31, 2024 at 4:32 am #15247206

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Anne,

Please notice the block type in the XML configuration code. It should be "kadence/image" instead of "core/image". For example:

<wpml-config>
	<gutenberg-blocks>
		<gutenberg-block type="kadence/image" translate="0">
		</gutenberg-block>
	</gutenberg-blocks>
</wpml-config>

then you can translate the image information only.

Look forward to your reply.
Thanks

February 2, 2024 at 12:15 am #15257244

anneR-12

Hi,

I inserted the code, but it did not change anything. When I try to translate a post, I am still asked to translate images both in the MEDIA section and the PAGE BUILDER section.

Anne

February 2, 2024 at 1:51 am #15257301

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

February 2, 2024 at 3:51 am #15257448

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I add the custom XML configuration code to WPML > Settings > Custom XML Configuration. Then edit the page in English > Click on Update > Visit the WPML Translation Editor and now the block "kadence/image" content isn't available there. Can you please recheck this?

<wpml-config>
    <gutenberg-blocks>
        <gutenberg-block type="kadence/image" translate="0">
        </gutenberg-block>
    </gutenberg-blocks>
</wpml-config>

Refer documentation
https://wpml.org/documentation/support/language-configuration-files/
https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

Look forward to your reply.
Thanks

February 2, 2024 at 12:03 pm #15258977

anneR-12

Hi Long,
Where are you looking at? I am still requested to translate every image twice.

To edit a post, I go to:

> Posts
> Then I click on the + sign under the Canada flag column.

In the translation for the posts, There is a media section with all the images. Then underneath it there is a Page Builder section which has all kadence block images (so all the images are repeated, except for the featured image).

In other to save and close the translation and for it to be published, I need to fill out ALL the section, so do each image twice.

February 2, 2024 at 12:12 pm #15259192

anneR-12

Apologies, the Kadence imge section does disappear when I update the English version first.

But, when I set an alt text in the translation, it does not appear on the front end (I use the Chrome extension Image Alt Text Viewer to see alt texts on a page, but there are other tools that do it too).

For example in article hidden link

The photo under subsection 2 is still showing in English, despite me having set it to be: Bataille Royale est un événement à Québec en mars in the translation tool.

So it's still not working for me, in fact I can't seem to translate in-post image alt text anymore. How can I fix that?

February 3, 2024 at 12:03 pm #15262025

anneR-12

Hi, I just wanted to follow-up on this. Is it possible to have live support?
Thank you very much.

February 5, 2024 at 3:33 am #15264164

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Sorry for the late reply, we don't work at the weekend. The problem is, the Kadence block image uses its own alt text (block settings), which is separated from the image alt text of the image so I'm afraid that you will need to translate the block content as in your first comment.

Or follow the suggestion from my colleague to use the Advanced Translation Editor to prevent translating one sentence multiple times. If you want to translate multiple sentences from the original language into one sentence in a second language, you can use the option join sentence. Please follow the documentation https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/#joining-sentences

If you want to have live support, please open a new chat session https://wpml.org/forums/forum/english-support/
there is a button to open the chat session when at least one supporter is available.

Look forward to your reply.
Thanks

February 5, 2024 at 7:13 pm #15268195

anneR-12

Hi Long,

Alright, so I've tried the advanced Editor. On my home page, the alt text are not appearing in French on the front end, despite me translating them in the advanced editor. See attached screenshot vs url: hidden link

What is the issue in this case?

Thank you,
Anne

February 6, 2024 at 1:59 am #15268693

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Because the block content "kadence/image" is excluded from translating with the XML configuration code above https://wpml.org/forums/topic/why-am-i-asked-to-translate-each-image-twice/#post-15257448
So you need to remove the code to translate the block content. I remove the code and re-translate the homepage, the block content is available in Advanced Translation Editor and displayed in the frontend as well.

Look forward to your reply.
Thanks

February 9, 2024 at 7:59 pm #15287453

anneR-12

Hi Long,
I need you help again, sorry.
Even with the advanced editor, I'm asked twice to translate each alt-text. This is very inefficient, I need to fix this I can't double my work like this for each image I translate.

Really keen to hear your suggestions to fix that.

Thank you,
Anne

February 9, 2024 at 8:32 pm #15287527

anneR-12

Let me give an example for us to work with:

URL: hidden link
Photo: image under 1. La Grande Dégustation de Montréal
Alt text translated in the advanced editor (see screenshot)
Front end alt text: English regardless: alt="La Grande Degustation De Montreal event in Montreal in October"

Note that Kadence suggested I turn ON the dynamic alt-text toggle on the post (see second screenshot). This makes the image alt text be defined at the Media level rather than the block level.

Thank you,
Anne

The topic ‘[Closed] Why am I asked to translate each image twice’ is closed to new replies.