Converting a text string to an inline placeholder in a HTML file

Good morning,

I have an issue/problem that I was not able to solve even searching specific posts in the SDL Community forums (or perhaps, I have missed them). Reference: SDL Studio 2017, Build 14.0.5889.5

Suppose you have an HTML file like this:

<html>
<body>
<a id='@@menu.586'>########</a>
<h1>Support request</h1>
<h2>support-request</h2>
<h3>index.php?option=com_breezingforms&amp;view=form</h3>
<h4></h4>
<h5></h5>
<h3>index.php?option=com_content&amp;view=article&amp;id=61</h3>
<h4>Send feedback to Manufacturer</h4>
<h5>Feedback</h5>
<a id='@@menu.247'>********</a>
<a id='@@menu.270'>########</a>
<h1>Feedback received</h1>
<h2>feedback-received</h2>
<h3>index.php?option=com_content&amp;view=article&amp;id=100</h3>
<p>Some text</p>
<h3>index.php?option=com_k2&amp;view=itemlist&amp;layout=user&amp;id=37&amp;task=user</h3>
<ul>
<li><a href="index.php?option=com_content&amp;view=article&amp;id=4&amp;Itemid=175">Some text</a></li>
<li><a href="index.php?option=com_content&amp;view=article&amp;id=5&amp;Itemid=156">Some text</a></li>
</ul>
</body>
</html>

When I load it using the HTML 5 file filter I obtain a preview like this that, in fact, is correct:

but I’d like to “transform” text strings:

index.php?option=com_breezingforms&amp;view=form

index.php?option=com_content&amp;view=article&amp;id=61

index.php?option=com_content&amp;view=article&amp;id=100

index.php?option=com_k2&amp;view=itemlist&amp;layout=user&amp;id=37&amp;task=user

to inline tags.

Provided that the string:

<a href="index.php?option=com_content&amp;view=article&amp;id=4&amp;Itemid=175">

has been already processed by the HTML 5 file filter, I have tried to use the Regex search pattern:

index.php(.*?id=[0-9]{1,4})|(.*?view=form)|(.*?task=user)

but I have not found a way to use it to create an inline tag. And, moreover, this Regex patterns sometimes includes the initial <h3> HTML tag.

Obviously, I can filter segments in SDL Studio and lock them.

I have also tried to use Cleanup Plug-in Tool, but I did not get a successful result.

Where is my mistake, and could anyone suggest a proper solution/procedure to transform these strings to inline tags?

Thank you for your help.

Claudio

Parents
  • Hi Claudio,

    Clearly the problem is that this is text and not a proper tag.  So you can use the Cleanup Task app from .  I tested it with your file and can get this:

    I guess that will do the trick for you?  You can't hide them in the segment because they have already been extracted as strings, but you can convert them to tags.  Frankly I think ti would be better to just copy to source, set as translated and lock them.  Then filter on unlocked.  You can do that easily across your project using the SDLXLIFF Toolkit.  But if you really do prefer to see them as tags like this then use these settings in the Cleanup Tasks app:

    Search for:

    index.php.+

    Replace with:

    <locked name="index" />

    So like this:

    Regards

    Paul

    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

Reply
  • Hi Claudio,

    Clearly the problem is that this is text and not a proper tag.  So you can use the Cleanup Task app from .  I tested it with your file and can get this:

    I guess that will do the trick for you?  You can't hide them in the segment because they have already been extracted as strings, but you can convert them to tags.  Frankly I think ti would be better to just copy to source, set as translated and lock them.  Then filter on unlocked.  You can do that easily across your project using the SDLXLIFF Toolkit.  But if you really do prefer to see them as tags like this then use these settings in the Cleanup Tasks app:

    Search for:

    index.php.+

    Replace with:

    <locked name="index" />

    So like this:

    Regards

    Paul

    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

Children