 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
The issue is actually not inside the theme; it is inside the Coloron Blocks Plugins.
As the issue only occurs for the Lens Type Block, the issue might be related to the
attributes named description and also name.
In your block.json and block-manifest.php you have for example:
- top-level block metadata: "description": "Coloron Lens Type"
- an attribute ALSO named: "description": { "type": "string" }
That’s a name collision between a reserved/commonly-used block.json property and an attribute key. Many tools (including translation extractors) flatten/merge data structures at some point, and collisions like this can cause exactly what you’re seeing: strings appear in the editor package, but don’t map back correctly to the block attributes when WPML rebuilds the translated post.
Also, name is a risky attribute key because it’s used everywhere as an identifier in block contexts (block “name”, block type “name”, etc.). Not guaranteed to break, but it’s another “collision-prone” key.
Why only Lens Type?
Because your other block (coloron/hero) doesn’t have those attribute keys colliding with metadata keys.
Best fix: rename attributes to non-reserved, unique keys:
- name → lensName
- description → lensDescription (or body, text, etc.)
Example:
"attributes": {
"imageUrl": { "type": "string" },
"imageId": { "type": "number" },
"lensName": { "type": "string", "default": "" },
"header": { "type": "string", "default": "" },
"lensDescription": { "type": "string", "default": "" }
}
You would then also need to adapt those attributes inside the index.js file.
|
 lauraR-37
|
Thank you for the suggestion!
I renamed the attributes tothese:
"lensName": {
"type": "string",
"default": ""
},
"lensHeader": {
"type": "string",
"default": ""
},
"lensDescription": {
"type": "string",
"default": ""
}
All text disappeared in the block editor.
I added the text to the default language then I opened the Advanced Translation Editor. Translations were still there.
I pressed the Save and Complete button.
The attributes are still not translated only the button.
Do you have other suggestion to solve the issue?
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
I am suspecting the cause of the issue is the Registration Lifecycle of those Custom Blocks:
Traditional Method:
When you use register_block_type('folder/'), WordPress parses the block.json file. WPML hooks into this event to find your attributes.
Manifest Method:
Your plugin uses wp_register_block_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' ). This loads a PHP array into memory instantly, bypassing the per-block "parsing" stage that WPML depends on for auto-detection.
It might be that WPML is not yet optimized for this registration method, and I will verify this together with out second tier support team.
Once we havenews for you, I will reach out here again.
|
 lauraR-37
|
Thank you I appreciate that you are checking it for me
|