Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Translator: File
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2013 at 07:58 UTC
Updated:
1 Dec 2016 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirWe don't provide field collection specific integration yet. And field collections' entity_translation integration is AFAIK not really working correctly yet.
How is your structure exactly? Are you using content or entity translation? If entity translation, is your field collection marked as translatable and it creates a field collection per language or is the field collection field untranslatable but has translatable field within it?
If you're using content translation or a translatable field collection field, then you will have to implement hook_tmgmt_source_translation_structure() and hook_tmgmt_field_type_populate_entity() for field_collection, recursively extract the fields with tmgmt_field_get_source_data() in the first hook, return them and then, when you get the translation of those fields, create a new or update an existing field collection for the target language.
TMGMT supports any kind of nested data item structure, although nobody has really tested it so far with something deeper than 3, might run into some problems with a certain depth due to the string length.
Would be great if you can start this.
Comment #2
miro_dietikerMake sure to first check the multilingual workflows with manual translations added through the UI.
Make sure, the modules natively deal with this right.
(because TMGMT source plugin just remote controls all this...)
Then you know if, the original modules need multilingual fixes first, or if it is just integrating the (working) logic with the tmgmt source plugin.
Comment #3
miro_dietikerThis is related to #1495130: Related source suggestions
Comment #3.0
miro_dietikerUpdated issue summary.
Comment #4
Vic_ commentedHi Miro, Yes I already checked that the configuration is correct.
I will try to add an patch within the next days.
best regards
Vic
Comment #5
Vic_ commentedHi Guys, I solved the problem. Question is should it be boiled down to a patch? or should be an "add'on"
https://drupal.org/sandbox/Vic/2104675
Best regards.
Comment #6
miro_dietikerI see you even need to modify the importer to support field_collections. I'm not so happy with the approach chosen here and i hope that we can support this export / import better. Please add more description to the code fragments about why and what kind of effect you intend.
In general, supporting major contribs such as field collections is something we love to add to the TMGMT core.
But in order to add extra features, we need test coverage.
Can you please add a test to show what case / configuration you exactly support?
I also see some commented-out code in the code that needs explanation:
http://drupalcode.org/sandbox/Vic/2104675.git/blob/refs/heads/master:/tm...
Comment #7
miro_dietikerUh.. Sandbox needs work.
Comment #8
berdirI'm fine with adding that to tmgmt core, happy to review patches.
Some quick notes:
- hook_init() shouldn't be necessary, make sure your class files are added to files[]
- .module and .info don't have the same name, that shouldn't work?
- When providing a patch, add your changes to html file plugin directly instead of overriding the class, I'm not sure what exactly you changed there.
Comment #9
owen barton commentedI am unclear how this relates to #1999802: Related source suggestions for field collections - this is translating field collections "directly" as entities (and using entity_translation), rather than as related sources? It seems that treating them as independent entities may - for sites that are not 100% translated - make it hard to identify which ones need translation (i.e. which parent entities have which language translations).
Comment #10
berdirYes, that is exactly the idea. Fields of the field collection would get added (recursively, if the field collection has other field collections attached).
As stated above, the sandbox module needs work, but should conceptually work. We might also discover some issues in our UI's with this, although we tried to be ready for cases like this in e.g. the review UI.
Would be great if someone can push it further :)
Comment #10.0
berdirUpdated issue summary.
Comment #11
Vic_ commentedHi Guys,
sorry for the late reply
im on it, Yeah, Berdir, I found some problems in "jobs" Where the GUI overlaps the title "field"
so its need a bit of work. il try to finish it up this week.
Comment #12
Vic_ commentedThe reason Im using hook_init
Is because it doesnt work if I put it in the info file
It doesnt fetch the files.
Comment #13
goron commentedHi everyone.
Since miro_dietiker thinks this would be a good addition to the core tmgmt module, I've converted the field_collection part of the sandbox to a patch. The code remains mostly the same as it is in the sandbox module. I've cleaned up comments, made coding standards changes, and removed that line of commented-out code, which I don't believe is necessary. It was attempting to check whether an individual field within the field collection should be translated, instead of just passing that responsibility to the field translation source plugin, which I think is a preferable way to do it.
I put the hooks in an include file within the field source pugin. Seems to make sense to me since it's technically a type of field, and mostly just ends up passing the processing to the tmgmt_field module itself. Let me know if you don't think this organization is the best.
A test is still needed, as pointed out in #6. But here's a start. Seems to work well for me locally (note that a field_collection patch is also required to get translation working: #1316162: Support content translation and host entity cloning).
Comment #15
goron commented13: tmgmt-field_collection-1973510-13.patch queued for re-testing.
Comment #17
goron commentedComment #18
goron commented13: tmgmt-field_collection-1973510-13.patch queued for re-testing.
Comment #19
miro_dietikerThank you for the update.
We ran into problems of multilingual support of field collection and are eagerly awaiting it to get committed.
I would suggest to wait with this feature till field collection finally decides to commit multilingual support.
Working on tests meanwhile is still encouraged.
Comment #20
sgurlt commentedI test #13 but run into an issue. The export does not translate the content of the field collection, it changes it for every language.
For example:
English to German text field inside field collection
This is my test -> Das ist mein Test
Every content changes to "Das ist mein Test" and not only the german.
EDIT: I downloaded and installed the sandbox module tmgmt extra and it seems to work, are there any know issues with this sandbox module?
Comment #21
luksakWhat is the status on this? Since #1316162: Support content translation and host entity cloning has been committed, can we start working on this issue?
Comment #22
miro_dietikerLukas, we are working hard on the 8.x branch of TMGMT. 7.x is not our feature focus.
We could still add support for Field Collections in TMGMT. The strict requirement for it is proper test coverage and positive feedback of the community using the code proposed. Thus switching to "needs work".
Keep in mind though that the multilingual issue from field collection is not fully fixed. Read the comments carefully and search for followups created.
Comment #23
luksakYes, I know.
Can you please tell me which followups are Field Collection translation issues relevant for this? Is #1344672: Field Collection: Field translation (entity_translation) support. the only one?
What translation methods are supported in the patch? Content translation, field translation or both?
I need this feature on a project soon and sponsoring is possible. Anyone? :)
Comment #24
wizonesolutionsAnyone holding onto any patches for this that they have not uploaded? :)
We might wind up trying to add support for FCs. They are crucial for us.
Comment #25
miro_dietikerWe will look into this issue.
First we will test some scenarios including nested field collections (where the parent is not translatable, but the child is)...
And then provide an update.
If it looks like we can make this work (or or clearly describe the limitations and they are acceptable), we will complete test coverage and get this in.
For Drupal 8 though, we will skip implementing this, as the direction of the debate is to deprecate Field Collections and recommend the usage of Paragraphs (which is perfectly TMGMT integrated already! Yay!)
Comment #26
primsi commentedComment #27
primsi commentedI've added a test, might still need some clenup.
Comment #28
primsi commentedComment #30
primsi commentedMeh, wrong patch.
Comment #33
primsi commentedComment #34
primsi commentedComment #35
primsi commentedComment #38
primsi commentedApparently the patch works fine with the latest dev of field collection but not the latest tagged release (beta11). I created an issue over there: #2803735: New tagged release beta13 I think postponing this until then makes sense.
Comment #39
miro_dietikerWe have a release!
Comment #42
miro_dietikerWoot :-) will commit later.
Comment #44
miro_dietikerCommitted, party! :-)
Not marking as needs port to 8.x-1.x due to #2784931: Proposal: Deprecate Field Collections for Drupal 8, focus on Entity Reference Revisions & Paragraphs