i18n allows to associate a taxonomy term with a language.
This patch associates a term created from a node to the same language like the node is associated to.
The implementation in _nat_sync_associations() might not be optimal, I will ask Jose Reyero, the maintainer of i18n, to review this section.
If a target vocabulary for nat-created terms is associated to a particular language, this patch might lead to unexpected behaviour: e. g. french terms from french nodes could end up in an english vocabulary. This is at least not very clean and could lead to logical errors, I will also ask Jose to review this part of the code.
This patch also deletes entries in nat when a taxonomy term is deleted.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | nat_i18n_0.patch | 5.76 KB | alex_b |
| nat_i18n.patch | 5.06 KB | alex_b |
Comments
Comment #1
jose reyero commentedThe patch looks fine.
About vocabularies with fixed language looks like they will be created and it's difficult to fix. But I can think of some workaround, making the variable 'nat_config' language dependent then setting up linked vocabularies for each language / node type. This may not work though if you are editing a node with a different language than the interface is in.
I'll give it a try and think of some other solutions.
Comment #2
alex_b commentedWhat I am worried about is wether the patch I put up is in shape for general use and thus for a commit to NAT. From an i18n perspective, what do you think Jose?
Comment #3
alex_b commentedThere was an error in the call of _nat_update_terms() that caused nat to delete terms when a node was udpated.
Comment #4
alex_b commentedWhat's missing in this patch is that if you create a language specific taxonomy term from a translated node, the term won't be registered as a translation to the corresponding term on the original node.
Comment #5
alex_b commentedWith the latest patch to translation.module (part of the i18n package) this patch is not necessary any more.
The translation module does neat things now like associating terms as translations when they are created by nodes from one translation set.
So:
Comment #6
slovan-mooney commentedWhere can I find the patch?? I l looked in the patch directory, but I did not see there.
Comment #7
slovan-mooney commentedWhere can I find the patch?? I looked in the patch directory, but I did not see it there.
Comment #8
alex_b commentedSorry for not being clear in this post. This was planned as a patch for translation module but went into i18nsync.module if I am not mistaken. Turn it on and try it out.