Hi everyone
I’m trying to configure the Translation Manager so that it ignores a specific module with the alias ModuleHTML
during translation.
Background:
I’m using the Umbraco Blockgrid, and within it I have a module called ModuleHTML
. This module contains custom HTML code for a third-party form.
Each language has a slightly different version of this form, meaning the HTML code varies per language.
The problem:
When I run a translation, the ModuleHTML
module is copied into the target language as-is, meaning the HTML code from the source language is carried over 1:1.
I’d like to prevent that, since it makes sense for the target language to contain different HTML in this case.
What I’ve tried so far:
-
Ignore Doctypes:
I tried using the setting under
Settings > Translation Manager > Sets > My Set > "Ignore Doctypes"
to exclude theModuleHTML
module.
However, this didn’t work – I suspect it’s because the module lives inside a Blockgrid.→ Question 1:
Is there any way to make Translation Manager ignore specific content within a Blockgrid? -
Custom ValueMapper:
Since the module uses a custom property, I thought about writing a Custom ValueMapper that just returns the original value unchanged.
Unfortunately, that didn’t work as expected.
Here’s my current code attempt:
https://gist.github.com/NicoM77/40f4b94fe68501531de5def4636566cb#file-codeeditormapper-cs-L58
Ideally (if ignoring isn’t an option), I would like to override the mapper for the
Umbraco.TextArea
property and apply custom logic:- If the property is not inside
ModuleHTML
→ use default behavior - If it is inside
ModuleHTML
→ skip translation and return the existing value
I haven’t been able to override or extend the
SimpleStringMapper
to make this work.→ Question 2:
Has anyone done something similar or knows how to implement this kind of logic? - If the property is not inside
I’m open to suggestions or alternative approaches. Maybe someone has already solved a similar scenario?
Thanks in advance!
ps: I’m using Umbraco V13