SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL Speech to Text
SDL Managed Translation - Enterprise
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Tridion Docs Developers
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
SDL Training & Certification
Language Technology Partner Group
SDL Academic Partners
SDL Enterprise Technology Partners
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 Contenta S1000D
SDL XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
What's New in SDL
Detecting language please wait for.......
If I have the following XML tag:
<Property ID="MaxNumberOfFiles" DataType="UINT" Value="1" Name-en="Maximum number of files" Description-en="This value defines the number of .csv files that are generated after a 'Record' command. The 'RecordDone' output is set to TRUE when the files have been created" ValueRange="1-65535" />
And only need to translate the text under attribute "Description-en", is it possible to extract all of the other attributes for display in the Trados Studio 2019 editor for "informational purposes" (text is present but locked). I know this is possible with tag elements themselves (inline / non-translatable / Include), but I can't seem to get it to work with attributes. Also tried with embedded content but to no avail.
Anyone know if this is possible?
Using the DSI viewer is one way as Daniel suggested. But surely a better way would be to create a custom preview and just show the information you want through a stylesheet? For example…
Try the attached:
ok - used the new XML version 2 and now I get the highlighting... and your error!
I tested all the xml filetypes now and will log a few bugs as a result of this exercise.
I think as long as you treat your file as XML you can't just concatenate the attribute values into a string and declare some of them locked. This might be possible if you treat it as text and use regex, but I did not look any further into this, so can't say much.
What about using the app DSI viewer (https://appstore.sdl.com/language/app/dsi-viewer/995/) to display the tag content:
Here is the file type and my test file based on what you provided:
Using the DSI viewer is one way as Daniel suggested. But surely a better way would be to create a custom preview and just show the information you want through a stylesheet? For example:
Pretty rough but I think you'll get the idea. Files attached in case it helps.
You only need to settings file to test it, but I also attached the stylesheet for reference.
Thank you both for the fast replies. When I get some time today I will try out both approaches and report back.
Thanks again for the replies! I like the DSI app solution because it works out of the box and provides information "on the fly", i.e. the screen is updated when moving along units, which is nice.
I would have also liked to try out the stylesheet solution from Paul, but I am a stylesheet noob apparently and am only able to get the attributes for the first unit shown but not for all the rest. If I'm not mistaken, this would not be an "on the fly" solution, but rather will present ALL of the information at once in the Preview dialog. If I could get ALL the information shown, then I could try my hand at formatting in a way that is pleasing to the eye (table, colors, font size, etc.).
Here's a sample of the REAL code:
<?xml version="1.0" encoding="utf-8"?><Configuration Location="Application/mapp/Config"> <Group ID="DataRecorder" Name-en="DataRecorder"> <Property ID="MaxNumberOfFiles" DataType="UINT" Value="1" Name-en="Maximum number of files" Description-en="This value defines the number of .csv files that are generated after a 'Record' command. The 'RecordDone' output is set to TRUE when the files have been created" ValueRange="1-65535" /> <Property ID="MaxFileSize" DataType="UDINT" Value="1000" Unit-en="kB" Name-en="Maximum file size" Description-en="Defines the size of a file" ValueRange="1-51200" /> <Property ID="DecimalDigits" DataType="UINT" Value="2" Name-en="Decimal digits" Description-en="Specifies how many decimal positions are saved" ValueRange="0-15" /> <Property ID="SaveInterval" DataType="DINT" Value="10000" Unit-en="ms" Name-en="Save interval" Description-en="Specifies the time interval used to transfer data from internal memory to the file" ValueRange="2000-3600000" /> <Property ID="BufferSize" DataType="UINT" Value="100" Unit-en="kB" Name-en="Buffer size" Description-en="Defines the size of internal memory" ValueRange="1-65535" /> <Property ID="PowerFailSafe" DataType="BOOL" Value="TRUE" Name-en="Power fail-safe" Description-en="Specifies whether the data should survive a power failure (internal memory in DRAM or SRAM)" /> </Group></Configuration>
And here's the modified stylesheet Paul was good enough to help with (basically changed for-each select):
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"xmlns:xsl="">www.w3.org/.../Transform"><xsl:template match="/"> <html> <body>
<xsl:for-each select="Configuration/Group"><br/> <i>ID = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ID"/></font></i><br/> <i>DataType = <font color="#0000FF" size="2"><xsl:value-of select="Property/@DataType"/></font></i><br/> <i>Value = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Value"/></font></i><br/> <i>Name-en = <font color="#0000FF" size="2"><xsl:value-of select="Property/@Name-en"/></font></i><br/> <i>ValueRange = <font color="#0000FF" size="2"><xsl:value-of select="Property/@ValueRange"/></font></i><br/> </xsl:for-each>
I looked into for-each and from what I understand it should find all instances of those attributes, but it only finds the ones from MaxNumberofFiles, not MaxFileSize for example. I don't know what I'm doing wrong. If it's something easy I'm overlooking, I would appreciate some additional help; otherwise, I am quite happy with the DSI app solution from Daniel, though I wish it was easier to adapt the font size to my aging eyes ;-))
Thanks again for all your help!
I got that far, but I was looking for a way to indicate where the translator is actually working on. This looks nice:
(I just added a line with "Description-en" to "for-each-select".)
But unfortunately each segment confirmation produces an error (although it does not seem to cause any harm):
Which version of Studio and which XML filetype did you use? Interestingly I did the same thing but the preview isn't highlighting for me... although I don't get an errror. I was going to test the other variations next:
I tried the above on 2019 SR2 CU5 and CU6 Beta, no difference. I used the XML2 filetype with Element Rules. Now I just tried the old XML filetype 1.2 with legacy embedded content and I also don't get any highlighting (also no error). However, I think you need to include the attribute into your XSL that is extracted for translation (Description-en). Only this could be highlighted anyways, but I don't see it in your screenshot.
Daniel Hug said:However, I think you need to include the attribute into your XSL that is extracted for translation (Description-en). Only this could be highlighted anyways, but I don't see it in your screenshot.
Look closer ;-) I put it at the top of each set of info.
Paul said:Look closer ;-)
Oh, I see, it's just bold text without the attribute name...
Well, after all this it seems that the DSI viewer is not such a bad option for the time being. Or you treat it as text and let Studio display the tag text.
Indeed... shame though. I like the preview option.
Thanks again for all of your help on this. Looks like I need to look more into XML stylesheets ;-)... Paul, your solution is working great, thanks for that. Your new attempt looks promising as well; maybe we'll see something like that in a future version of Studio ;-). All the best, you two!
Any chance these for bugfixes to get done in time for CU6?
I would say zero chance because I don't think Patrik Mazanek has even been made aware of them all yet, and it's also a bit late for CU6. For your reference the bug numbers are:
CRQ-18395: XML: Unable to generate the file for previewing. The document may no longer be available
CRQ-18404: XML2- highlighting in preview fails when you have multiple segments in a paragraph unit
CRQ-18408: XML 1 - no preview highlighting