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.

Tagged: 

This topic contains 21 replies, has 3 voices.

Last updated by Andreas W. 1 week, 2 days ago.

Assisted by: Andreas W..

Author Posts
October 28, 2024 at 9:45 am #16336788

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Which file? I suppose this should use esc_html_e() as call:
https://developer.wordpress.org/reference/functions/esc_html_e/

October 28, 2024 at 9:48 am #16336806

laurentC-27

File path: wp-content/themes/pcvue/blocks/corp-site/corp-site-certifications/corp-site-certifications.php

October 28, 2024 at 9:57 am #16336868

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I understand correct that this is a ACF Block?

You can not translate ACF Blocks with WPML String Translation.

Blocks should get rendered on the content of the page or post that they are used on and need to get translated with the WPML Translation Editor or the WordPress Editor.

Guide:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-acf-blocks-with-wpml/

October 28, 2024 at 10:19 am #16337027

laurentC-27

So we need to move text from php file to the blocks?

October 28, 2024 at 11:32 am #16337489

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am not sure at this point how your custom theme works.

Are you using ACF Blocks that are directly coded into PHP without using the Gutenberg Editor for editing?

October 29, 2024 at 1:22 am #16339983

laurentC-27

We are using Gutenberg blocks to add content for the section
But with the "Download CERTIFICATE", all download buttons will have same text like that so we put it in php (template) file instead of adding them in Gutenberg blocks.
I think WPML will translate text from template file no matter what how it is rendered?

In that case, may I know how WPML translates phrases from template with text domain?
Like via javascript or any WP/WPML hooks/filters.

October 29, 2024 at 2:34 pm #16342973

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

It looks like you were already able to solve this issue.

fr.jpg
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.