This patch implements support for localized vocabularies (through i18ntaxonomy) for the node tokens [vocab], [vocab-raw], [term] and [term-raw].
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | taxonomy-token.patch | 4.13 KB | googletorp |
| token_node.taxonomy.i18n.patch | 1.82 KB | Hugo Wetterberg |
Comments
Comment #1
Hugo Wetterberg commentedThe changes are made in the function node_token_values in token_node.inc
Comment #2
roborn commentedYeap, it works great.
Tkx, alot! ;)
Comment #3
florian.cathala commentedAwesome ! Thanks :o)
Comment #4
gregglesThanks for providing these. However...
Then this code should be added to the i18n module.
Comment #5
jose reyero commentedWe can't really do too much till token module allows some way to override existing tokens defined by other modules.
Anyway, we can provide new tokens using some i18n namespace 'i18n-xxx'
Comment #6
gregglesYes, that's exactly what I think makes sense for i18n to do.
Comment #7
googletorp commentedSo I needed this for terms, made a patch that works and then found this thread afterwards, looks like I ended up doing things in the lines greggles suggested.
Anyways, I basically ripped the code off from the tokens module implementing hook_token_list and hook_token_values, and added some language testing before sending the term through the tt function.
~Jakob
Comment #8
jose reyero commentedThis starts looking good but the tokens group shouldn't be i18ntaxonomy, but 'term' or 'vocabulary'. Let's just use the same as the token module uses, and the same token names just with a 'i18n-' prefix (prefix just for token names, not for objects).
Comment #9
googletorp commentedOkay, so it's been almost 2 months, so I'm still a bit rusty since I haven't looked at this since.
Anyways, I don't really understand your reply. The patch above for the terms was create by copying the relevant part from the token module and then adding in the language checks and i18n specifics. In other words, this is exactly how the token module does it. The token names are also as you requested above, same as tokens only with the "i18n-" prefix. So I'm a bit puzzled as to why you are asking for things i believe I already have provided. If I'm mistaken or have misunderstood you please write in greater detail what's lacking in the patch, so I or some one else can improve it so we can get this feature into i18n.
Comment #10
mikl#8: These tokens are in the node group, since the patch is showing taxonomy terms attached to nodes in the node's defined language.
I've looked over the patch, and it looks fine. It does have an instance of "vocabolaries" but that aside, I'd say it's RTBC.
Comment #11
jose reyero commentedYes, I don't know which code I was looking at, sorry.
Thanks, committed. Nice work.