How to make XML comments translatable in Studio?

Hi,

I need to make comments from an XML file translatable in Studio:

<!--Comment Text-->

The following XPath expression works in XMLSpy but not in a Studio XML Parser Rule (set to Always Translatable):

//*/comment()

 

I assume that Studio simply does not allow to extract XML comments. Is there any other solution pre-/post-processing the file?

 

Thanks in advance!

Christine

Parents
  • Hi Christine,

    You're right in that it's not supported. It's a little strange that this contains localizable content as this would be used specifically for part of the file that should not be processed, or has been commented out. I think the use of proper localisation properties is a better way to handle notes that might also become translatable content. I'd be interested to hear why these need to be translated... I know these things happen but just wondered if there was a good reason?

    Probably the only workaround would be to search replace with a non-commented syntax, and then put it back afterwards. This is the only way you'll expose these through the studio parser.

    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

  • Hi Paul,
    thanks for the confirmation!
    Actually, these comments contain hyperlinks which help the translator to better understand the content they are supposed to translate.
    A style-sheet is the obvious solution, but we know that only few of our translators take the extra time to call up the preview...

    Therefore our idea was to make the comments/hyperlinks translatable so that they are inevitably visible in the Studio Editor and could be copied over to a web browser. They would count as placeable, so just one word (or even zero).

    Comments are visible in the All Content view, but a) you have to deliberately choose this display filter Option (many translators won't) and b) the Hyperlinks are included in non-translatable tags and cannot be copied.

    I am already working on the style-sheet, just wanted to make sure that my XPath is correct and Studio does not allow me to apply it for comments ;-)

    Thanks
    Christine
  • Hi Christine,

    If the files are in your control couldn't you use <loc:note> instead? Might be closer to what you wanted to do without a stylesheet? A stylesheet would have been my next suggestion... I like these a lot, think they are far better for displaying helpful information to the translator.

    On the testing... maybe this tool will be helpful for you if you haven't seen it before?

    xpathvisualizer.codeplex.com/

    It's free... pretty old (2011) but is perfect for testing xpath expressions before you use them in Studio.

    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

  • Hi Paul,
    thanks!
    These are client's files, so if we do pre-processing, we need to do post-processing. Structure is not optimal in other aspects, no use discussing with the customer...
    Thanks for the XPath Visualizer link - but I am quite comfortable with XML Spy and its XPath intelliSense :-)

    Will test whether the new Studio 2017 also allows a quick preview of changed preview xsl - it's quite a lot of clicking in Studio 2014/15....

    Christine
Reply Children
No Data