Posted by arthurf on March 13, 2008 at 2:40pm
| Project: | Internationalization |
| Version: | 6.x-1.x-dev |
| Component: | Blocks |
| Category: | task |
| Priority: | normal |
| Assigned: | arthurf |
| Status: | closed (won't fix) |
Issue Summary
In working with i18n and media mover (specifically, dealing with files), I think there needs to be a hook that is fired in the i18nsync_node_translation() function that allows other modules to interact with the syncing process. I'll write a hook and abstract out the existing cases to use this hook inside i18nsync_node_translation(). I'll submit a patch here in the next few days.
Comments
#1
Here's a patch that does the following:
1) adds a hook_i18n_sync
2) reorders some of the functionality in this module to implement this hook
3) cleans up a few pieces because of this hook
The point behind this is to allow other module to implement the syncing process and to help tidy that process up so that it's easier to extend. My use case is for media_mover_api to make its files available to all translations. I will also write a quick module which syncs node views across translations and possibly one for reviews.
thanks!
#2
Woops, didn't get that quite right. Here's another go. Also, this should probably address the taxonomy stuff, but this is good for now
#3
The idea looks good, the patch looks a bit too complex though. Simply too many parameters when $source and $translation should be enough. For the field list, I think drupal_alter should be more adequate.
I don't see why we should change the naming. Also the hooks and parameters need some more comments.
Please, simplify, comment and repost. Just keep it as simple as possible.
#4
Ok, here's another go at this. At the risk of being a trouble maker :) I've not really simplified things that much. I'll see if I can convince you and then if not, I'll try again.
I left in the hook for the configuration form. While you're quite right that we could leave this up to a form alter for what ever module wants to do this, what I like as a developer is having a centralized way to do things. For example- I'd like to have one or two functions that deal with syncing the data in my modules. My form alter stuff is already much to cluttered. It has the added bonus that it encourages people who are writing syncing functions to have the configuration in the same place which helps with keeping the interface consistent.
What I did do was remove the $hook option. I left the $config- while this might not be so useful now, I see it as being potentially useful, particularly if in the future we add $op = 'load' or $op = 'delete' - potential use cases for the future. On the other hand, we could get rid of it by moving a few lines of code. If it's a deal breaker for you, I'll cave.
#5
I hope I'm not overstepping things, but I'd like to make this functional on Media Mover so that it can provide files to translations. I'll post my code here when I submit it for reference.
#6
There is some experimental code here:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/media_mover...
I haven't fully experimented with it, but it's an idea.
#7
I'd think that any big changes like this would need to happen on HEAD first and then a consider doing a backport.
#8
#370449: Provide a hook_synchronize() was marked duplicate
#9
What's the current status? I'd like to get i18nsync and Media Mover working together happily on Drupal 6.
#10
Agree with drewish. New features are for 6.x only. The patch needs updating.
#11
#1303518: Clean up the issue tracker. Close old issues without follow up.