SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL MultiTerm
SDL Passolo
SDL Speech to Text
SDL Managed Translation - Enterprise
SDL MultiTrans
SDL TMS
SDL WorldServer
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL XPP
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Language Developers
Tridion Developers
Tridion Docs Developers
Xopus Developers
Community Help
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
SDL Training & Certification
Style Guides
Language Technology Partner Group
SDL Academic Partners
SDL Approved Trainers
SDL Enterprise Technology Partners
XyUser Group
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic SDL Tridion Docs User Group
SDL Tridion UK Meetup
SDL Tridion User Group New England
SDL Tridion West Coast User Group
SDL WorldServer User Group
Tridion Docs Europe & APAC User Group
Tridion User Group Benelux
Tridion User Group Ohio Valley
SDL MultiTerm Ideas
SDL Passolo Ideas
SDL Trados GroupShare Ideas
SDL Trados Studio Ideas
SDL Machine Translation Cloud Ideas
SDL Machine Translation Edge Ideas
SDL Language Cloud TMS Ideas
SDL Language Cloud Terminology Ideas
SDL Language Cloud Online Editor Ideas
SDL Managed Translation - Enterprise Ideas
SDL TMS Ideas
SDL WorldServer Ideas
SDL Tridion Docs Ideas
SDL Tridion Sites Ideas
SDL LiveContent S1000D Ideas
SDL XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
What's New in SDL
Detecting language please wait for.......
I'm trying to define text enclosed in single or double curly brackets in an HTML file as placeholders. For example.
<p>Do not translate this {{ variable }} and don't translate that { variable } either.</p>
The following expression works fine Notepad++, but it doesn't work in SDL Studio.\{+[^}]+\}+1. Why doesn't the expression work?1. What regex flavor(s) does SDL Studio support?
support?
Hans Kröger
Perhaps you should start by explaining where you are doing this? So how are you adding this expression to support this in an HTML file?
I created a new HTML based file type. I then selected Embedded Content.In the Embedded Content dialog box, I enabled Other elements identified by and selected the Structure information option.I then clicked Configure > Add, selected Placeholder and entered the regex
As I just explained there is. But as you have still not provided me with a file that shows clearly where that script sits I actually don't know whether it's going to work or not. It cannot possibly be outside of all elements... so which element is it in?
I created an example as I showed you above where I placed it in the body element (because you have not told me where it should go) and in there it seems to have the effect of overruling all other rules. But if you comeback and tell me that actually it's not in there then maybe there is some way of tackling this.
But to answer this:
Hans Kröger said:Is there really no way to tell SDL Studio to treat all text enclosed in {} or {{}} in HTML files as placeholders no matter where the text occurs in the HTML file?
Of course there is. You can create your own regex based filetype that just treats the entire file as text. Now you can do whatever you like.
But if you want to use html as the basis of this then you need to follow some rules and we can only validate those rules if you actually give us a real file that is complete instead of these partial snippets that force us to keep guessing.
Hans Kröger said:but the method that you suggested is rather cumbersome.
Perhaps... but maybe still preferable to the alternatives.
You could also hire a developer and create your own filetype specifically for handling Shopify files.
Thanks for looking into this! It looks like I'll have to create a regex based file type, which is a bummer, because the file is more than 70% HTML.FYI, the code in curly braces occurred before and after the starting <body> tag as well as after the closing </body> tag. I.e., it'd be impossible to define tag based rules.That's why I was asking whether there's a possibility to globally mark this tags as placeholders.
ok Hans Kröger
It is difficult because the html parser is based on looking at files that are ordered with text always coming inside the elements.
The embedded content parser looks at what's inside the elements and treats them as text which is what allows you to handle your variables.
If you now inject script outside of these elements then you can only define an embedded processor to handle the content between the highest parent element... in your case the <html> element by the sounds f it. So in effect you are now saying treat the entire file as text and you'll define the rules for everything.
This will be quite tricky but if you're happy to handle everything as placeables it's easy enough:
Gets you this:
It's not too bad because structural elements will be moved out and you won't make a mistake. Inline tags, which I don't have in this example will be trickier since they won't be handled as opening and closing pairs and the translator will have to be very diligent to make sure they are placed in the right order.
Frankly, I think that if this type of file is something we're going to be seeing more and more of then it would be worth developing a filetype to handle this sort of embedded content in a different way. Perhaps you should raise this here and see if anyone else thinks it's a good idea:
http://ideas.sdl.com
Thanks for all your help! I really appreciate it. If we get these files more often, I'll definitely raise this at http://ideas.sdl.com.
Although only indirectly related to this question, it would be a good "idea" to extend file tagging to file types other than TXT. I will present the request in the specified link.
Anthony Rudd
When you do that can you elaborate a little on why you want to do this and for which filetypes?
I often need to translate software manuals that contain many "tag" names (usually written in CamelCase or some variant). It would desirable to convert these to tags and so prevent them from being translated, and more importantly, exclude them from the Spell Checker (I have had cases of hundreds of false positives). Principally MS Word and Excel.
Anthony Rudd said:Principally MS Word and Excel.
Excel and Word already support this within the filetype. Why can't you use it in the way it is currently implemented? Just asking because your idea needs to be clear on this point.
Excel was a typo. Is Word embedded content processing possible for Word (I have Trados 2019)?
Hi Anthony Rudd
Can't access 2019 anymore, but Studio 2021 surely has the feature:
Daniel
I hope this is not a stupid question: but how do I see these settings?
Same for 2019... but only the new Word filetype:
Thanks, I thought that I had tried clicking the icon - obviously not!. OK now. I may have been offput by the Embedded Content for Excel also being able to be set from Project Settings -> Embedded Content Processors
Is there a problem with the segmentation hints? Segment 6 is not displayed for "Include With Text"