locked inline tags together with <okp:options extractUntranslatable="yes"/>

31 views
Skip to first unread message

Stephan (MittagQI)

unread,
Mar 20, 2025, 8:20:50 AMMar 20
to okapi-users
Hi everyone,

first of all, a warm welcome to everybody. This is my first post here :-)

I'm struggling about XML-Filter together with the option extractUntranslatable.
Let's say I have this text:

<text>this text <noTranslate>should not</noTranslate> be translated.</text>

normally I lock inline tags, which should not be translated, with the following rules:

<its:withinTextRule withinText="yes" selector="//noTranslate" />
<its:translateRule translate="no" selector="//noTranslate" />

and result looks like this:

<source xml:lang="en">this text <bpt id="1" ctype="x-noTranslate">&lt;noTranslate&gt;</bpt><ph id="2">should not</ph><ept id="1">&lt;/noTranslate&gt;</ept> be translated.</source>

So the part "should not" is locked for translation. When I add the rule

<okp:options extractUntranslatable="yes"/>

result looks like this:

<source xml:lang="en">this text <bpt id="1" ctype="x-noTranslate">&lt;noTranslate&gt;</bpt>should not<ept id="1">&lt;/noTranslate&gt;</ept> be translated.</source>

So the part "should not" is NOT locked any more. This does not feel correct for me.
Only solution to lock the "should not" part ist by replacing the rule:
<its:translateRule translate="no" selector="//noTranslate" />
with
<its:localeFilterRule localeFilterList="!*" selector="//noTranslate" />

then result is again what I want and looks like this:
<source xml:lang="en">this text <bpt id="1" ctype="x-noTranslate">&lt;noTranslate&gt;</bpt><ph id="2">should not</ph><ept id="1">&lt;/noTranslate&gt;</ept> be translated.</source>


So, question, is this behaviour a bug or a feature?

As mentioned above, it does not feel correct for me. Because when I add the <okp:options extractUntranslatable="yes"/> to an existing rule-set, I have to check very carefully if this can effect any translate="no" rules.


Stephan

Chase Tingley

unread,
Mar 23, 2025, 5:45:42 PMMar 23
to Stephan (MittagQI), okapi-users
Based on both the documentation for that flag and the sample document provided in the original issue (https://bitbucket.org/okapiframework/okapi/issues/1319), the purpose of this flag was to allow exclude trans-units to be extracted with translate="no", for example to provide context. So this behavior you've demonstrated seems like a bug. 


--
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 visit https://groups.google.com/d/msgid/okapi-users/4531ec63-2012-4b2b-8004-d5cbea37dbd1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages