Download & Extend

i18n support for the term and vocab node tokens

Project:Internationalization
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

This patch implements support for localized vocabularies (through i18ntaxonomy) for the node tokens [vocab], [vocab-raw], [term] and [term-raw].

AttachmentSizeStatusTest resultOperations
token_node.taxonomy.i18n.patch1.82 KBIgnored: Check issue status.NoneNone

Comments

#1

The changes are made in the function node_token_values in token_node.inc

#2

Status:needs review» reviewed & tested by the community

Yeap, it works great.

Tkx, alot! ;)

#3

Awesome ! Thanks :o)

#4

Project:Token» Internationalization
Version:6.x-1.11» 6.x-1.x-dev
Status:reviewed & tested by the community» needs work

Thanks for providing these. However...

localized vocabularies (through i18ntaxonomy)

Then this code should be added to the i18n module.

#5

We 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'

#6

Anyway, we can provide new tokens using some i18n namespace 'i18n-xxx'

Yes, that's exactly what I think makes sense for i18n to do.

#7

Status:needs work» needs review

So 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

AttachmentSizeStatusTest resultOperations
taxonomy-token.patch4.13 KBIgnored: Check issue status.NoneNone

#8

Status:needs review» needs work

This 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).

#9

Status:needs work» needs review

Okay, 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.

#10

Status:needs review» reviewed & tested by the community

#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.

#11

Status:reviewed & tested by the community» fixed

Yes, I don't know which code I was looking at, sorry.

Thanks, committed. Nice work.

#12

Status:fixed» closed (fixed)

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