It would be useful if there was a way of discovering the URLs of the available translations for a given entity object, e.g. if there's a base node at node/123 then I'd like a token that show me http://example.com/de/das-node for the German translation and http://fr.example.com/le-node for the French translation.

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new17.11 KB
new2.06 KB

This kinda works:

Works. Kinda.

damienmckenna’s picture

Note, in the screenshot there's no URL given for Spanish because the node hasn't been translated into that language yet.

damienmckenna’s picture

I'm not sure where this needs to go. I wrote the patch to go with #2597301: Expand hreflang support, auto-add fields for each locale, for the Metatag module. OTOH the patch is generic enough that there may be other use cases, so maybe it should just go with Entity Translation, as this patch provides. And I'm sure the patch could be improved to provide the normal url token structure ala [node:url]. Thoughts?

damienmckenna’s picture

StatusFileSize
new2.05 KB
new1.13 KB

Slightly improved logic on the token generation.

damienmckenna’s picture

FYI I'm going to add these tokens to #2597301: Expand hreflang support, auto-add fields for each locale, but if if it's ever added to ET I'll be happy to remove them.