Hi, when i create a translation of a content type that have noderefence fields, i like, if the node referenced not have a translation yet, i can create a translation like 'create and reference'

Comments

markus_petrux’s picture

Status: Active » Postponed

Do you mean a "Create translation and reference" feature? hmm... sounds interesting, but this process would need to know which node you would like to translate, and this exposes a workflow that's not covered here.

I don't have time to add features like this one at this moment, but I would accept patches for evaluation.

markus_petrux’s picture

Title: buton to create translation » Button to create translation and reference
izarco’s picture

... but this process would need to know which node you would like to translate ...

When you translate a node, by default the node reference fields are filled with the nodes of the source translation (in the case that this referenced nodes not have translation, such as our use case). Then we have the node which we woudl like to translate.

markus_petrux’s picture

Aha! Thanks for the hint. Honestly, I haven't played with translations with this module enabled, yet. So that helps, and this feature really makes sense.

I'm keeping the request as postponed, however, as I'm pretty busy right now. I hope to get some time in a few weeks. Not really sure exactly *when*, but I mean it should not go beyond a few months, just a few weeks. Still, patches are welcome.

markus_petrux’s picture

Component: User interface » Node relationships extensions

Just added a few more issue components. Sorry for the noise.

markus_petrux’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Postponed » Postponed (maintainer needs more info)

When you translate a node, by default the node reference fields are filled with the nodes of the source translation (in the case that this referenced nodes not have translation, such as our use case). Then we have the node which we woudl like to translate.

hmm... not sure why, but now that we've started to play with i18n on our project I don't see this behavior, or there's something I'm missing. :-|

This is how I see it:

a) When a node translation is started, node reference module tries to find translations for the nodes in node reference fields. If no translation is found, node reference module leaves the node reference field empty! So the translation form is loosing track of the nodes referred on the source translation. This operation performed by node reference module is not optional.

b) When a referred node was based on a type that's not translatable, leaving the node reference field empty is ok. But, if it was translatable, we may want to keep track of this so it is still present on the translation form, and there will be an error if you submit the form, but here we could add a "Create translation and reference" button. This button would take the nid of the non-translated node from the node reference field and use it to open a modal dialog frame with the translation form of that node. When submitted, the nid of the translated node could be used to replace the value of the node reference field, as we already do with the "Create and reference" button.

Am I missing anything? Is this work flow correct?

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Active

Just wanted to mention I started to work on this. It will work as follows:

When a translation is started, for node reference fields that have missing translations the following warning will be rendered on top of the nodereference widgets:

"Missing translation for Referred node title [nid: XXX]. This post can't be referenced. Translate and reference now."

The node reference field will still contain the untranslated reference. This will enable the "View on new window..." button, so that can be used to inspect the untranslated node.

The last sentence of the "Missing translation" warning will be a link. This link will open on a modal dialog to allow the user to create the translation. When the translation is submitted and saved, the modal dialog will close and the node reference field will be automatically populated with a reference to the newly created translation.

The "Missing translation" warning will also disappear as soon as the contents of the node reference field is changed.

This feature will require the "Create and reference" option to be enabled for the node reference field, and of course it requires the core translation module, with additional support for i18n.

markus_petrux’s picture

Title: Button to create translation and reference » Add an option to "Translate and reference"

Now that 6.x-1.1 has been released, my intention is to commit this feature as soon as I got it working on my development environment. This will allow others try the dev version for a while, and we can then fix anything that may arise.

This is complex because of the changes made by CCK itself and Node reference to fields when a translation is started, as explained previously. So let's see how it goes...

I expect to have it basically done by this week end. If I can't this week end, it will be the next due to lack of time, probably. Well, time will tell...

It would be great to know if there's more people interested in this feature, if so, then please chime in and subscribe. Specially when the feature is committed, so that we can know if it is working ok out there or not. Thanks.

markus_petrux’s picture

Status: Active » Fixed

Committed to CVS, including updated README and translations folders.

I have also updated to project page to reflect the availability of this new feature.

Please note that if you are upgrading from a previous version of NR, then you need to run update.php. The "Translate and reference" feature requires this module to load just after the content module, so the module weight needs to be changed in the {system} table for this feature to work properly.

My intention is to keep this in dev for a while, and if no major problems arise, then release a new stable version with this feature included.

Thanks in advance to all those that try the dev version. If you do, please post some feedback in this issue, so that we know it's been working or not for you. Thanks. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.