I'm not sure the problem happens in OmegaT or in the Okapi plugin/filter. To be on the safe side (and for the record), I create a ticket for OmegaT.
subfilter=okf_html
<option name="useCustom" value="okf_json@foo.fprm"/>
The source file is JSON and it contains HTML data, e.g.
{
"key": "abc123",
"text": "<div id=\"foo\"><strong>bar</strong></div>"
}
The filter definition (omegat/okf_json@foo.fprm
):
extractIsolatedStrings.b=false
extractAllPairs.b=false
exceptions=current_translation
useKeyAsName.b=true
useFullKeyPath.b=false
useLeadingSlashOnKeyPath.b=false
escapeForwardSlashes.b=true
useCodeFinder.b=false
noteRules=
extractionRules=
idRules=key
genericMetaRules=
codeFinderRules.count.i=1
codeFinderRules.rule0=</?([A-Z0-9a-z]*)\b[^>]*>
codeFinderRules.sample=&name; <tag>
codeFinderRules.useAllRulesWhenTesting.b=true
subfilter=okf_html
subfilterRules=
(Already done in the sample project attached.)
okf_json@foo.fprm
file in the omegat folder of the project (done*) and indicate the relative path (just the filename) to the custom filter definition in the OmegaT project settings: Edit Project > File Filters > JSON files (Okapi) > Options > Use the following filter parameters file: okf_json@foo.fprm
(done*).subfilter=okf_html
in the okf_json@foo.fprm
.The sample project attached also contains an XLIFF file that shows the expected results for the original JSON file.
I can confirm the HTML subfilter works perfectly when I use my JSON filter definition to create the translation kit in Okapi Rainbow. The XLIFF created in Rainbow is included in the project.
If a developer can confirm that the problem does not happen in OmegaT's code
This is resolved on the Okapi plugin end on ticket okapi-plugin#37. I think this ticket can be closed (I don't have permissions to update it).
Last edit: msoutopico 2022-06-24