JSON Filter - Omega-T - Displaying the key / path alongside with the translation

34 views
Skip to first unread message

bruno baudry

unread,
Jun 24, 2020, 11:08:21 AM6/24/20
to okapi-users
Hi there,

Very new with this framework so I hope my question makes sens.

We installed the plugin and tested to open a JSON file.
Now only the content is displayed.
We would like to see the keys to help grasping the context when translating in OMEGA-T

I tried creating an okf_...@myself.fprm
with these settings

extractIsolatedStrings.b=false
extractAllPairs.b=true
useKeyAsName.b=true
useFullKeyPath.b=true

Looking at the filters.xml in my OMEGA-T windows roaming folder looks like the custom setting is found

<filter className="net.sf.okapi.lib.omegat.JSONFilter" enabled="true">
        <files sourceFilenameMask="*.json" targetFilenamePattern="${filename}"/>
        <option name="includeTUName" value="yes"/>
        <option name="useCustom" value="C:\_mesProgs\OmegaT\plugins\okf_...@myself.fprm"/>
        <option name="useDefault" value="no"/>
    </filter>


But it doesn't do what I hope it did.

Is it feasible and if yes now ?

Thanks in advance.

Bruno

Marc

unread,
Jun 24, 2020, 11:56:07 AM6/24/20
to okapi...@googlegroups.com
Dear all,

with the XML-Filter or the XML-Stream-Filter it is possible to exclude
tag content completely from the generated xliff.

For example for the XML-Filter with the ITS-Rule

<its:translateRule selector="//context" translate="no"/>

for anything below <context>

Is it possible to include it in the generated xliff, but set it to
'translate="no"' instead?

I did not find any option for this.

Thank you very much for your help!

best

Marc

Yves Savourel

unread,
Jun 25, 2020, 9:21:55 AM6/25/20
to Marc, okapi...@googlegroups.com
Hi Marc,

I don't think we have any option like this.
The XML Filter will simply exclude the element from the XLIFF output if it's a structural element, or make it in inline code if it's a element within-text.

-ys
--
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/45923b53-7ede-11b3-5289-1ed45472172f%40marcmittag.de.

Marc

unread,
Jun 26, 2020, 8:45:58 AM6/26/20
to okapi-users
Hi Yves,

thank you for your answer.

So it is really, like I thought, and I did not just miss something.

That's a pity.

Do you think, it would be easy to develop something like that and make
it part of Okapi? Does it even make sense from your perspective?

And how about the filter chaining or perhaps even better a general
possibility to define a Regex subfilter for locking complete segments or
protecting parts of them as internal tags?

Is something like this in planning?

best

Marc
--
Marc Mittag
MittagQI - Quality Informatics

Service Desk for Requests:
https://jira.translate5.net/servicedesk
Please request a login via mail, if you have none

MittagQI
Konrad-Lorenz-Weg 10
D-72116 Mössingen
Germany
Tel.: ++49 (0)7473/220202
Fax: ++49 (0)7473/220211
mailto: Ma...@MittagQI.com
Web: www.MittagQI.com

Info zum Anhang anbei:
Standardmäßig liegt jeder E-Mail bei MittagQI die PGP-Signatur unseres jeweiligen Mitarbeiters bei,
um Ihnen die Möglichkeit zu geben,
E-Mails an uns zu verschlüsseln.



Kuro Kurosaka

unread,
Jun 27, 2020, 1:07:40 AM6/27/20
to okapi-users

Actually a group of people including me once tried to write a Filter Step as a generic solution over years. But it turned out such Step is much more difficult than we thought. It was so easy to break the complex file formats like .docx, .xlsx etc.The activity stopped here.

https://bitbucket.org/okapiframework/okapi/pull-requests/300/subfiltering-step/diff


Kuro

Marc

unread,
Jun 27, 2020, 5:17:11 AM6/27/20
to okapi-users
Thank you very much, Kuro, for the info.

It's a pitty, that it stopped, but I understand, that it is complex.

Perhaps for most use cases it would be sufficient to be able to protect patterns within segments with regex in general, like it is already possible for some file formats.x

However I understand, that someone needs to have the possibility and motivation to put enough time and/or money in this.x

best

Marc

--
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.
Reply all
Reply to author
Forward
0 new messages