Hi Mihai,
The data category to use for notes in locNoteRule. The translateRule element is just to tell what is translatable or not (if needed).
Use the selector attribute of locNoteRule to point to the translatable node you want to comment on and the locNotePointer attribute (or one of the other “locNote*” attributes) to tell where to get the comment from.
For example, in the ITS rules below we indicate that the text-unit extracted from //msg/data should use any comments that is a sibling node.
(There is no need to specify a translateRule here because <data> will be extracted by default):
<?xml version="1.0"?>
<Res>
<prolog>
<its:rules xmlns:its=http://www.w3.org/2005/11/its version="2.0">
<its:locNoteRule locNoteType="description" selector="//msg/data" locNotePointer="../comment()"/>
</its:rules>
</prolog>
<body>
<msg id="FileNotFound">
<!-- Indicates that the resource file {0} could not be loaded.-->
<data>Cannot find the file {0}.</data>
</msg>
</body>
</Res>
So you get the following with “tikal -x test.xml”:
<trans-unit id="2" its:locNote=" Indicates that the resource file {0} could not be loaded." its:locNoteType="description">
<source xml:lang="en">Cannot find the file {0}.</source>
<target xml:lang="fr">Cannot find the file {0}.</target>
<note> Indicates that the resource file {0} could not be loaded.</note>
</trans-unit>
This example is adapted from the example 31 in the ITS 2.0 specification: https://www.w3.org/TR/its20/#locNote-implementation
I think the XML Filter does implement the full locNoteRule, even the things like locNoteRefPointer.
The tests results are shown in Localization Note section of the ITS 2.0 Test suite Dashboard (column “enlaso” is the Okapi implementation).
One more thing: Don’t forget to use namespaces in the selectors if your source file has namespaces. People often forget about them and wonder why the rule doesn’t work.
I hope this helps.
-yves
--
You received this message because you are subscribed to the Google Groups "okapi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/okapi-users/CAK69zbkC2f4iJ6DbS8x2c0H%2BMXMmMQ7%3DGjmV01ebNzJ3j6kqhg%40mail.gmail.com.