I tried to export in both html and xlf.
HTML returned blank translations after replacing text (or what else should I do?!).
XLF returned xml formatted text. Example:
Imported xlf file source text:
<source xml:lang="en"><p><strong>PAYMENT METHODS</strong></p> <p>Online&nbsp;with Paypal</p> <ul> <li>all major electronic cards</li> <li>immediate processing</li> <li>secure &amp;&nbsp;guaranteed</li> <li>no additional costs</li> </ul> <p>Offline&nbsp;with Cash on Delivery (COD)</p> <ul> <li>pay the courier at your door</li> <li>extra charge of 5€ at checkout</li> </ul></source>
Imported xlf file target text (note that there is no difference apart from pure translation):
<target xml:lang="it" state="translated"><p><strong>METODI DI PAGAMENTO</strong></p> <p>Online con Paypal</p> <ul> <li>tutte le principali carte elettroniche</li> <li>elaborazione immediata</li> <li>sicuro e garantito</li> <li>nessun costo aggiuntivo</li> </ul> <p>OOffline con contrassegno</p> <ul> <li>paga il corriere alla consegna</li> <li>costo aggiuntivo di 5€ alla cassa</li> </ul></target>
Returned this on translator interface:
Source:
<p><strong>DELIVERY INFO</strong></p>
<p>Ready to ship in 7 days.</p>
<ul>
<li>Express courier</li>
<li>1-2 days in Europe</li>
<li>Live tracking</li>
</ul>
Translation:
<p><strong>CONSEGNA</strong></p> <p>Pronto per la spedizione in 7 giorni</p> <ul> <li>Corriere espresso</li> <li>1-2 giorni in Europa</li> <li>Tracciamento in tempo reale</li> </ul>
And this on translated product display (I mean, html tags are shown to the user!):
<p><strong>CONSEGNA</strong></p> <p>Pronto per la spedizione in 7 giorni</p> <ul> <li>Corriere espresso</li> <li>1-2 giorni in Europa</li> <li>Tracciamento in tempo reale</li> </ul>
I am working with entity translation, and of course trying to translate a Filtered html text.
Also, the workflow is not efficient at all in XLF manual translation because the target tag is not prepopulated! If it was, we could just replace all text at once with a text editor like Sublime Text 2.
Comment | File | Size | Author |
---|---|---|---|
#16 | tmgmt-translate_from_file_html_contents-2272487-16.patch | 1.34 KB | liberatr |
| |||
#11 | 2272487-13.patch | 660 bytes | Leksat |
|
Comments
Comment #1
kopeboy CreditAttribution: kopeboy commentedComment #2
kopeboy CreditAttribution: kopeboy commentedComment #3
Matroschker CreditAttribution: Matroschker commentedIt seems this is the same as my new item (https://drupal.org/node/2279265) - I created today, sorry!
You can work around us (at least for XLIFF) if enabling 'Extended XLIFF processing', but in this case I got problems with my image tags - it seems that some free XLIFF tools doesn't support this. The result is, that my images disappear on my page after accepting.
Matroschker
Comment #4
Matroschker CreditAttribution: Matroschker commentedAny update here?
I checked this issue again with
TMGMT: Last updated: June 27, 2014 - 18:13, Last packaged version: 7.x-1.0-rc1+7-dev
If 'Extended XLIFF processing' is disabled, if translation was imported the HTML tags are shown to the user not the interpreted html code.
If 'Extended XLIFF processing' is enabled, the HTML code is well interpreted, but now my images are moved to another place on the site, eg if the image was within a table, now it is outside.
That means: no changes
Matroschker
Comment #5
dasginganinjaSubscribing. I've got the same issue going on. I'm thinking about creating my own module that extends the file translator plugin and just decodes the entities to get around it. I guess the real question is what is the proper way of doing this in the long run?
Comment #6
molenick CreditAttribution: molenick commented+1
Comment #7
jonnydev13 CreditAttribution: jonnydev13 commentedI'm still seeming to have this issue.
When I try to import an xliff file after creating a job in xliff and translating it, it just tells me there was an error with no more details about what the error was.
When I try to import an html file after creating a job in html and translating it, it says it succeeds but the translated page has no content when I try to review it. This is probably a different issue, but the translated content was part of a drupal book and both the original and the translated one now show up in the book outline.
Is there anybody who has done coding on this module who can give any direction to all of the people on this thread?
Comment #8
dragonfire353 CreditAttribution: dragonfire353 commentedHere's a quick fix for new translation imports for 7.x1.0-rc1.
Add this to entity/tmgmt.entity.job_item.inc on line 630 or if that isn't right in function addTranslatedDataRecursive near the end before $this->updateData:
Again, quick fix so use at your own risk.
Comment #9
Bram Tassyns CreditAttribution: Bram Tassyns commentedWe also had this problem for html export.
I fixed our issues by changing the import function in tmgmt_file.format.html
(basically, don't just take the text content, but convert all encountered elements back to xml as well)
Comment #10
Say_Ten CreditAttribution: Say_Ten as a volunteer commentedSame issue here and the same solution with html_entities_decode(). My concern would be if there's import systems that don't mess it up, would this function be aware or should it be handled in the XLIFF file_format code?
Comment #11
Leksat CreditAttribution: Leksat at Amazee Labs commentedThe following works well for many of our company clients since middle 2015:
We had no issues with this code.
Comment #12
Leksat CreditAttribution: Leksat at Amazee Labs commentedJust found that #2279265: Without 'Extended XLIFF processing' review shows eg '<' instead of '<' has the same patch, but not sure which issue should be marked as duplicate :/
Comment #13
sri@re CreditAttribution: sri@re commentedHi am new to drupal .I just select file translator and i import html file
but am getting this error "Failed to validate file, import aborted. " can anyone please clarify?
Comment #14
Kristen PolTried code in #9 above and it didn't work in my case so I used this which is a bit hacky and could be better but seems to work so we can keep moving:
Comment #15
lobodakyrylo CreditAttribution: lobodakyrylo as a volunteer commentedCode #9 and #14 don't work for RC3
This is my code:
Comment #16
liberatrHere is a version of the last comment as a patch.
Comment #17
liberatrNOTE if your translated content contains CSS in a style tag you will get output like this:
Fix (if this matters to you):
$content = str_replace(array('<![CDATA[', ']]>'), '', $content);
Comment #18
liberatr