Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is it somehow possible to set a flag on documents you want to exclude from translation jobs. a True/False property will do fine.
So when a content editor want to send the entire site with all children to translation these nodes will be excluded.
not out of the box, you can set properties and doctypes to be exluded on sets, but not via a flag from the user.
however you could write something to remove those nodes before a job got submitted.
there is a TranslationJobService.Submitting event which fires before a job is sent to a provider (so xliff file, or via an API).
you could intercept the job at this point and then look through the content nodes it contains.
foreach(var node in job.Nodes)
// node.MasterNodeId is the ContentNodeId for the source page.
// you could load the job via the content service, check for your
// flag property and remove it from the collection if its set.
i think ideally we should have a similar even on translation node creation - but we don't in the current version 😢
OK, it would help if i checked the code.
there IS a creating event on translation nodes.
if you register for this event you can stop the node from being created and it never gets added to the translation job.
again node.MasterNodeId would be the content id for the source page.
Great - I'll try it and let you know.
I never got this one done.
I have tried make an event component which fires
But I dont know how to manipulate the nodes in here.
The specs has also changed a bit. It's actually just a single property eg. "bodyText" I want to remove from the translation job.
if its just a single property you want to remove , you could put it in the exclude properties list, or you could change it's data type to a non-translatable text box (we have a package that adds those data types here : https://www.nuget.org/packages/Jumoo.TranslationManager.NoneTranslatableText/)
but if its still based on a user flag, then in the TranslationNodeService.Creating. you will need to traverse the properties.
within a TranslatonNode all the text is stored in the Groups value (this is tabs in the old Umbraco UI terms).
then within the groups you have a list of TranslationProperties in the Properties value.
if the property you want to exclude is at the top level then the Source value in the property contains the name of the property. Then you can remove it from this list.
However if it is a value nested inside something else then you will need to recurse through the values, to get to it. a TranslationValue can have InnerValues, and these may also contain more InnerValues (think a textbox inside a grid inside a nested content element!).
quick example (not actually ran this, but it should get you started if you still need to have custom code checking).
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class PropertyRecurseComposer : ComponentComposer<PropertyRecurseComponent>
public class PropertyRecurseComponent : IComponent
public void Initialize()
TranslationNodeService.Created += TranslationNodeService_Created;
public void Terminate()
TranslationNodeService.Created -= TranslationNodeService_Created;
private void TranslationNodeService_Created(TranslationNodeEventArgs e)
// Node if of the content item we created the translation from - e.Node.MasterNodeId
// so you could load that up to check for set values. before you go into the remove
// groups are tabs.
foreach(var group in e.Node.Groups)
var removals = new List<int>();
// tabName in group.DisplayName
// properties in the tab.
foreach(var property in group.Properties)
// alias of property in doctype : property.Alias
// you could remove based on property.Alias, but the UI already lets you do this in config.
// if (property.Alias.InvariantEquals("somePropertyAlias"))
var shouldRemove = RemoveValueCheck(property.Source);
if (removals.Count > 0)
group.Properties.RemoveAll(x => removals.Contains(x.Id));
/// returns true if the translationValue should be removed from its parent.
private bool RemoveValueCheck(TranslationValue value)
if (value.EditorAlias.Equals("SomeRemoveProperty", StringComparison.InvariantCultureIgnoreCase))
// this is the property's editorAlias of the thing we want to remove
else if (value.HasChildValues())
// else has choldren, recurse in and check if we want to remove the value from a nested item.
var removals = new List<string>();
foreach (var innerValue in value.InnerValues)
foreach (var removal in removals)
Thanks but e.Node.Groups return null - What could be the problem ?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted