How do I add the CleanUp Source batch task to my default sequence?

Hi folks,
I have two questions about the CleanUp Source batch task:
1. I have a plain text like this: Your trial period expires in 30 {{ glossary term="Days" }}.
I want to convert it into a pair of tags like thisYour trial period expires in 30 [{{ glossary term=">Days<" }}]

As a workaround, I know how to replace that plain text with two placeholders on both sides of the word Days, which is fine for me too:
Screenshot showing multiple instances of the text string ' glossary term=' ' ' with arrows pointing towards them, indicating areas of focus or issues.
But I'm just curios if I can replace it with a pair of tags instead of placeholders. Is it possible with this batch task? And if yes, what regex I should apply? 

2. How can I add the CleanUp Source batch task to my sequence so that it runs during files preparation. The instruction page reads "you can create a custom sequence so that this is ran automatically during project creation", but I can't find a hint as to how. Something like Prepare without project TM but with CleanUp Source.

I think I should ask specifically, but I will much appreciate all ideas from others as well (if any).
Thank you

 



Generated Image Alt-Text
[edited by: Trados AI at 4:08 AM (GMT 0) on 29 Feb 2024]
emoji
Parents
  • If I was preparing the text file from scratch I'd be inclined to use the out of the box regex delimited text filetype rather than take the approach you have here.  I think it might be easier... although I haven't seen your entire file.  But based on your example, it feels as though it'd be easier.

    If nobody answers you I'll take a look at the tags later... this app always needs a bit more thought for me.

    How can I add the CleanUp Source batch task to my sequence so that it runs during files preparation.

    You can only do this if you have the professional version of Studio as this supports custom batch tasks.  However, here's a little hack you could use.

      <InitialTaskTemplate Description="A custom task sequence that uses Cleanup source." Name="Cleanup Source" Id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
        <SubTaskTemplates>
          <SubTaskTemplate TaskTemplateId="Sdl.ProjectApi.AutomaticTasks.Conversion" />
          <SubTaskTemplate TaskTemplateId="Sdl.ProjectApi.AutomaticTasks.Split" />
          <SubTaskTemplate TaskTemplateId="Cleanup Source" />
          <SubTaskTemplate TaskTemplateId="Sdl.ProjectApi.AutomaticTasks.Translate" />
          <SubTaskTemplate TaskTemplateId="Sdl.ProjectApi.AutomaticTasks.Analysis" />
        </SubTaskTemplates>
      </InitialTaskTemplate>

    Add this into your project template below here:

    </SettingsBundles>

    For example, I see this in my default.sdltpl now:

    Screenshot of Trados Studio showing XML code with a highlighted section for adding a custom task sequence named 'Cleanup Source' to a project template.

    I'm not sure what this looks like in Freelance but I think it'll be the same.  You might even get away with simply adding this line in the appropriate place:

    <SubTaskTemplate TaskTemplateId="Cleanup Source" />

    Easy enough to undo if it breaks something!!

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub



    Generated Image Alt-Text
    [edited by: Trados AI at 4:08 AM (GMT 0) on 29 Feb 2024]
  • However, here's a little hack you could use.

    Thank you Paul. I could add it to the sequence and I made sure that the right regex file was checked in the Source Cleanup wizard but it didn't give me the expected effect. Weirdly, when I run the same batch task individually, after the project has been all set and prepared, it works fine. However, after all this tweaking and fiddling with Cleanup batch task, I think that having it in my batch task sequence by default is not a good idea at all. It is even better for me that I could not get what I was after =D 
    I also tried the regex delimited text filetype workflow by following the instructions in your video (https://www.youtube.com/watch?v=apnui_flpyE) but I think my previous screenshot was a bit misleading. I have those inserts among other text:
    Screenshot of Trados Studio showing a list of glossary terms including Days, Months, Quarters, and Years within the source cleanup wizard.
    I want to protect plaintext links, tags and other such untranslatable details and elements from modification. The Fuzzy Match Repair and MT features sometimes modify my text without notice (like adding or removing a space or replacing a word in a long link like Folders/Projects/Recent/Tasks/Subtasks that becomes Folders/Projects/Recent/Task/Subtasks, etc.). I have disabled the Fuzzy Match Repair feature but I don't want to disable MT because it helps me a lot. Hence all my strivings =)
    However I haven't tried the Embedded Content feature yet, which actually seems to be a better choice now after all my experiments. Will try it.
    Anyway, thank you very much for your detailed input. It was useful to me.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:08 AM (GMT 0) on 29 Feb 2024]
Reply
  • However, here's a little hack you could use.

    Thank you Paul. I could add it to the sequence and I made sure that the right regex file was checked in the Source Cleanup wizard but it didn't give me the expected effect. Weirdly, when I run the same batch task individually, after the project has been all set and prepared, it works fine. However, after all this tweaking and fiddling with Cleanup batch task, I think that having it in my batch task sequence by default is not a good idea at all. It is even better for me that I could not get what I was after =D 
    I also tried the regex delimited text filetype workflow by following the instructions in your video (https://www.youtube.com/watch?v=apnui_flpyE) but I think my previous screenshot was a bit misleading. I have those inserts among other text:
    Screenshot of Trados Studio showing a list of glossary terms including Days, Months, Quarters, and Years within the source cleanup wizard.
    I want to protect plaintext links, tags and other such untranslatable details and elements from modification. The Fuzzy Match Repair and MT features sometimes modify my text without notice (like adding or removing a space or replacing a word in a long link like Folders/Projects/Recent/Tasks/Subtasks that becomes Folders/Projects/Recent/Task/Subtasks, etc.). I have disabled the Fuzzy Match Repair feature but I don't want to disable MT because it helps me a lot. Hence all my strivings =)
    However I haven't tried the Embedded Content feature yet, which actually seems to be a better choice now after all my experiments. Will try it.
    Anyway, thank you very much for your detailed input. It was useful to me.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:08 AM (GMT 0) on 29 Feb 2024]
Children
No Data