-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions around @translate #5
Comments
The Plug-in takes the following block level elements:
The The block element itself will probably contain inline elements like span or codeph, these are processed in turn into xliff compliant None of the autotranslate tools I've seen take XLIFF directly - they are usually JSON based, so when running the autotranslate dita command there is an effort to amend the texts fragments to be compliant to the tool - I think Bing does best here. Profiling is not used - this transform is just a transform to XLIFF everything under this directory. If you need something more complex, I'd just run the Given the implicit restrictions, only the DITA elements listed above are currently candidates for translation - I'm not running preprocess, so I'm looking directly for elements with those names so if you've implemented specialization the transform won't find your new elements - you could just add something to a list here: https://github.com/jason-fox/fox.jason.translate.xliff/blob/master/xsl/add-md5-src.xsl#L77 |
From @xephon2
|
There is some residual As an example: DITA source<p>
The following lines are the origin of
<term translate="no" xml:lang="la">Lorem Ipsum</term> :
</p>
<ul>
<li>
Loves or pursues or desires to obtain
<codeph>pain of itself</codeph>, because it
is pain, but occasionally circumstances occur in which toil and
pain can procure him some great pleasure.
</li>
</ul> XLIFF 1.2 outputThe <trans-unit xmlns:dita="dita-ot.org" approved="no" id="10044" xml:space="preserve">
<source xml:lang="en">The following lines are the origin of
<x id="d3e11" ctype="x-dita-term" translate="no" xml:lang="la">Lorem Ipsum </x>:
</source>
<target xml:lang="de" />
</trans-unit>
<trans-unit xmlns:dita="dita-ot.org" approved="no" id="54947" xml:space="preserve">
<source xml:lang="en">Loves or pursues or desires to obtain
<x id="d3e20" ctype="x-dita-codeph" translate="no">pain of itself </x>, because it is pain,
but occasionally circumstances occur in which toil and pain can procure him some great pleasure.
</source>
<target xml:lang="de" />
</trans-unit> XLIFF 2.1 outputThe <unit id="10044" fs:fs="p">
<originalData>
<data id="sd4e11"><term translate="no" xml:lang="la"></data>
<data id="ed4e11"></term></data>
</originalData>
<segment state="initial">
<source xml:space="preserve" xml:lang="en">
The following lines are the origin of
<pc id="d4e11" dataRefStart="sd4e11" dataRefEnd="ed4e11" fs:fs="code">
<mrk translate="no" type="term" id="md4e11">Lorem Ipsum</mrk>
</pc>:
</source>
<target xml:lang="de" />
</segment>
</unit>
<unit id="54947" fs:fs="li">
<originalData>
<data id="sd4e20"><codeph></data>
<data id="ed4e20"></codeph></data>
</originalData>
<segment state="initial">
<source xml:space="preserve" xml:lang="en">
Loves or pursues or desires to obtain
<pc id="d4e20" dataRefStart="sd4e20" dataRefEnd="ed4e20" fs:fs="code">
<mrk translate="no" type="term" id="md4e20">pain of itself</mrk>
</pc>, because it is pain, but occasionally circumstances occur in which toil and pain can
procure him some great pleasure.
</source>
<target xml:lang="de" />
</segment>
</unit> The following DITA elements gain a
|
In addition to that list, the block elements are currently always translated, so unless changes are made to the existing XSLT transforms it currently makes no sense to annotate any of the following DITA elements with
This would be easy to fix, since the plugin already ignores elements with no text within them (where the Fletcher's checksum is zero) so the XSLT logic could be amended to look for |
I've tweaked the code and added two new test cases. Please reinstall from dita uninstall fox.jason.translate.xliff
dita install https://github.com/jason-fox/fox.jason.translate.xliff/archive/master.zip No TranslateSupport added for dita -f xliff-create \
-i ../plugins/fox.jason.translate.xliff/test/create-xliff2-translate-no/document.ditamap \
--xliff.version=2 Yes TranslateSupport added for dita -f xliff-create \
-i ../plugins/fox.jason.translate.xliff/test/create-xliff2-translate-yes/document.ditamap \
--xliff.version=2 The equivalent tests have also been added for XLIFF 1.2. Could you check to see if this is working as expected? |
I will do, but this will take a few weeks. |
To implement profiling, the current mechanism I see working for this is to run the normalized The question is whether your existing I've always been skeptical that XLIFF can work successfully with DITA |
Hi @jason-fox, We would need the The given example below shows a warehouse topic containing a single phrase which is defined in the technical standard EN 60335-2-24. This means, all content of the file should be remain English, only the text <?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:dometic:names:tc:dita:rng:dometicWarehouse.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="urn:dometic:names:tc:dita:rng:dometicWarehouse.rng" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<dometic-warehouse id="WHS_EN60335-2-24" xml:lang="en-US">
<title translate="no">EN 60335-2-24</title>
<conbody>
<table frame="all" rowsep="1" colsep="1">
<tgroup cols="2">
<colspec colname="c1" colnum="1" colwidth="1.0*"/>
<colspec colname="c2" colnum="2" colwidth="1.0*"/>
<thead>
<row>
<entry translate="no">Component</entry>
<entry translate="no">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<ph id="use-potable-water">WARNING: fill with potable water only.</ph>
</entry>
<entry translate="no">
<p>7.12 The instructions for <b>ice-makers</b> not intended to be connected to the
water supply shall state the substance of this warning.</p>
</entry>
</row>
</tbody>
</tgroup>
</table>
</conbody>
</dometic-warehouse> I don't think that normalizing content before translation is a viable solution for us. Fluenta (https://github.com/rmraya/Fluenta) is able to mirror the entire topic and directory structure. IMHO I cannot re-create the entire directory, map and topic structure from normalized DITA. But maybe I'm wrong. For us it is a must that all directories are correctly mirrored. Whenever something happens in the
|
Three questions received from @xephon2
The text was updated successfully, but these errors were encountered: