<p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="VW:Comment"> [Test of conditional text for translation.]</span></p>
<p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="VW:Comment"> [Test of conditional text for translation.]</span></p>
Maybe something like this as your condition:
span[
@data-condition
=
"VW:Comment"
]
Then set it as non-translatable:
I created this file to test:
<!DOCTYPE html> <html> <body> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="VW:Comment">Don’t translate me</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span>Translate me</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="VW:Comment">Don’t translate me either</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span>Do me too</span></p> </body> </html>
And it extracts like this:
So seems to work for me anyway.
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,
Thank you for your prompt reply to my post. I had gone that far and wasn't clear in my question.
What I'm trying to configure are multiple conditions for the same attribute with different conditions values.
For example:
data-condition="condition_1" then DO NOT TRANSLATE
data-condition="condition_2" then DO NOT TRANSLATE
data-condition="condition-3" then DO NOT TRANSLATE
ELSE TRANSLATE
Thanks
Why don't you provide a sample file with just the bits you need? Asking a question like this and expecting someone else to do all the work may prevent you getting a timely response.
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
I used this test file:
<!DOCTYPE html> <html> <body> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="condition_1">Don’t translate condition 1</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span>Translate me</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="condition_2">Don’t translate condition 2</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span>Do me too</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="condition_3">Don’t translate condition 3</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span>And don’t forget me</span></p> <p class="Numbered" dir="ltr">Click to place the object in the drawing.<span data-condition="condition_4">Condition 4 or any other condition is just fine for translation</span></p> </body> </html>
First I tried this which I believe should work as it is valid xpath 1.0:
span[@data-condition="condition_1" or @data-condition="condition_2" or @data-condition="condition_3"]
But it doesn't. So I did this instead:
Just duplicate the rule we created first and use whatever attribute values you need. Gave me this:
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
Works like a charm! Thank you.
Hi guys,
A similar question: is there a way to say "Translatable" based on certain conditions? Like <code> would always be "Not Translatable", except when its "class = c1".
I solved the problem manipulating the XML.
But I wonder if wouldn't be a more simple way to do this.
Thank you all!