Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should switch to XLIFF format, also to allow more metadata being placed in jobs / job items.
Comment | File | Size | Author |
---|---|---|---|
#8 | switch_to_xliff_format-1971672-8-interdiff.txt | 2.71 KB | mbovan |
#8 | switch_to_xliff_format-1971672-8.patch | 8.92 KB | mbovan |
#5 | switch_to_xliff_format-1971672-5-interdiff.txt | 1.28 KB | mbovan |
#5 | switch_to_xliff_format-1971672-5.patch | 6.36 KB | mbovan |
#3 | switch_to_xliff_format-1971672-3-interdiff.txt | 5.41 KB | mbovan |
Comments
Comment #1
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedHere is the patch that provides XLIFF format support. It's depending on tmgmt_file module and recent changes made in #2646158: Support XLIFF export for a single job item.
Comment fixes from OHT feature: Add services based languages & language pairs list as well. :)
Comment #2
BerdirNice.
what about changing it so data $query can either be an array or string. Possibly rename to $data. And then we call multipartEncode() ourself, pass that in and the only additional argument here is then the content_type. Might keep this simpler.
Add types everywhere. $name is also definitely not an int :)
This looks very generic, but it's actually hardcoded to having a single file named upload. With my changes suggested above, it might be simpler to just inline this into the new method instead of trying to be generic. We can refactor it later if we have more use cases for this.
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedThis patch should address all the points above.
Comment #4
BerdirI'd use $xliff for this. Also clarify in the description that this is not a file but a string that we send as a file.
According to the documentation, this should end with .xliff.
Comment #5
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedMissed #4.2 in documentation, sorry.
Comment #6
BerdirI think we can remove the old code here, at least prepareDataForSending().
I'm pretty sure you will also need to update import/parsing of the translation.
Comment #7
miro_dietikerJust a quick note on required followups:
The XLIFF default converter can not handle HTML attributes that need translation such as alt, title. We need to make it aware of that.
Comment #8
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedRemoved prepareDataForSending(). Left it at first as I thought it might be needed in order to support both text resources and file resources.
Changed parsing function to support importing received XLIFF format based on #2646682: Update XLIFF to support string imports.
Also, fixed a small bug in configuration UI where an error appears if we don't have public/secret keys set.
Comment #9
BerdirGreat, committed.