Skip to content Skip to sidebar

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
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

Tagged: ,

This topic contains 4 replies, has 0 voices.

Last updated by simonL-71 6 hours, 3 minutes ago.

Assisted by: Itamar.

Author Posts
December 8, 2025 at 12:28 pm #17643860

simonL-71

I've built several custom, static Gutenberg blocks. Most of them follow the same structure: a dedicated title field plus InnerBlocks for the content. Here’s one example:

The block.json defines attributes like the media fields, title, and optional icon.
{
"$schema": "hidden link;,
"apiVersion": 3,
"name": "palllm/text-image-item",
"version": "0.1.0",
"title": "Text Image Item",
"category": "layout",
"parent": "palllm/text-image",
"icon": "admin-generic",
"example": {},
"supports": {
"html": false,
"anchor": true,
"align": ["full"]
},
"attributes": {
"mediaId": {"type":"number","default":0},
"mediaUrl": {
"type":"string",
"default":"",
"source":"attribute",
"selector":".text-image__img",
"attribute":"src"
},
"mediaAlt": {
"type":"string",
"default":"",
"source":"attribute",
"selector":".text-image__img",
"attribute":"alt"
},
"title": {
"type":"string",
"default":"Section Title"
},
"iconEnabled": {"type":"boolean","default":false},
"iconId": {"type":"number","default":0},
"iconUrl": {
"type":"string",
"default":""
},
"iconAlt": {
"type":"string",
"default":""
}
},
"textdomain": "theme_textdomain",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css"
}

save.js
import {useBlockProps, RichText, InnerBlocks} from '@wordpress/block-editor';

export default function save({attributes}) {
const {title, mediaUrl, mediaAlt, iconEnabled, iconUrl, iconAlt} = attributes;

const defaultImageUrl = 'https://cdn.wpml.org/wp-content/themes/palllm/img/preview/front-view-plant-growing-from-pellets.webp';
const displayUrl = mediaUrl || defaultImageUrl;
const wrapperClasses = ['container'];

const mediaEl = (

);

const iconEl = (() => {
if (!iconEnabled) {
return null;
}

if (!iconUrl) {
return null;
}

return (

);
})();

return (

{mediaEl}

{iconEl && (

{iconEl}

)}

);
}

In save.js, everything renders correctly — except for one thing:

gets translated on the frontend exactly as expected, but the title rendered via
refuses to translate. It stays in German, even though the editor detects and translates it without any issues.

In the first screenshot you can see that it's correctly translated in the editor. In the 2nd screen you can see that only the paragraph is translated.

I've tried via wpml-config.xml. But didn't help:

December 8, 2025 at 1:32 pm #17644209

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

You got disconnected, and this is what I last wrote in the chat.

ChatGPT keeps pointing to the same place. Please, change your block.json title attribute to be sourced from HTML:

"title": {
    "type": "string",
    "source": "html",
    "selector": "h2",
    "default": "Section Title"
}

Please let me know if this helps.
If that does not help, I'll consult our second-tier supporters.

Regards,
Itamar.

December 8, 2025 at 1:41 pm #17644226

simonL-71

I've tried this but it doesn't help or fix the issue

December 8, 2025 at 3:02 pm #17644549

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for trying my suggestions.

If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please back up the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

December 8, 2025 at 4:12 pm #17644783

simonL-71

I can't edit my last private message but the FTP form concatenated the ftp server url and folder.

The FTP credentials are for the root of the project. Just use hidden link as server url