Doing a multi-lingual site and it'd be great to have the node's language as a token to pass to pathauto.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

FileSize
1.24 KB

here's a re-roll.

i should add that this is now a core field so it doesn't belong in the i18n per #176449: Token support (primarily for pathauto).

greggles’s picture

FileSize
1.3 KB

Added filtering and a little if statement so it gets set to blank string in case there is no language (which I assume can happen...).

drewish’s picture

greggles, i guess the xss filtering can't hurt but it does see a little over the top, core doesn't run the role names through a filter but like i said it doesn't hurt anything.

the language should always be set--even if it's just to an empty string--since it's loaded from the node table.

greggles’s picture

Status: Needs review » Fixed

Great - I removed the crazy if, left in the filtering, and applied this to the 6.x branch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

colan’s picture

For contexts outside of nodes, see #975116: Create a 'language' token type (D7) (for content and interface languages).